android-5.0-lollipop

Ripples not showing with selectableItemBackground as foreground on a CardView with a Android 5.0 device

走远了吗. 提交于 2019-12-05 02:52:34
I'm running this on a Nexus 5. Here's part of the code for my CardView: CardView cardView = new CardView(getActivity()); cardView.setRadius(4); LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, 400); lp.setMargins(32, 16, 32, 16); cardView.setLayoutParams(lp); cardView.setContentPadding(50, 50, 50, 50); ... cardView.setForeground(selectedItemDrawable); And here's how I get the selectedItemDrawable: int[] attrs = new int[] { R.attr.selectableItemBackground }; TypedArray ta = getActivity().obtainStyledAttributes(attrs); selectedItemDrawable = ta

Android Lollipop issue - Cannot load image from camera to ImageView

谁说我不能喝 提交于 2019-12-05 02:45:08
问题 On any version before android lollipop, the below code works fine. For some reason, from a certain version of android (around 5.0), whenever an image is captured from camera, the screen rotates 90 degrees to the right and back (Not only auto-rotate on my device is off, my activity is defined as portrait, it's not supposed to be rotating at all!). Once the screen rotates back, the ImageView presents the previous (original) image. Any suggestions? The camera intent: if (result.equals("CAMERA"))

What does TranslationZ actually do in Android?

和自甴很熟 提交于 2019-12-05 02:29:16
Hi I am developing android application in which I am trying to implement new material design features. I tried to apply both elevation property and TranslationZ property but it is not working. <Button android:id="@+id/button1" style="@style/ButtonStyle" android:layout_width="wrap_content" android:layout_height="wrap_content" android:clickable="true" android:text="Name" /> <?xml version="1.0" encoding="UTF-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <solid android:color="#0073ff" /> <corners android:radius="16dp" /> </shape> <style name=

MultiDex support in Android application error

最后都变了- 提交于 2019-12-05 02:05:15
I want to use Android L compat libs. after adding the relevant code to gradle, I get the error: Error Code: 2 Output: objc[36290]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.7.0_67.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.7.0_67.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined. UNEXPECTED TOP-LEVEL EXCEPTION: java.lang.IllegalArgumentException: method ID not in [0, 0xffff]: 65536 at com.android.dx.merge.DexMerger$6.updateIndex(DexMerger.java:501) at com.android.dx.merge

How to enable Non market application in Managed Profile (Android 5.0) programmatically

自闭症网瘾萝莉.ら 提交于 2019-12-05 01:24:23
问题 Hello I was checking Android 5.0 samples there was sample BasicManagedProfile. Using that I have created managed profile successfully. But it was managing only Market applications (Downloaded from Google Play) as managed application. But I tried with custom say it HelloWOrld application that is not available on Market. It gave me the error " java.lang.IllegalArgumentException: Only system apps can be enabled this way ." devicePolicyManager.enableSystemApp( BasicDeviceAdminReceiver

EditText input type textCapSentences not working on Lollipop

你离开我真会死。 提交于 2019-12-05 01:19:55
I have implemeted android:inputType="textAutoComplete|textCapSentences" in my xml code. When I run it on kitkat , textCapSentence works fine but when build is run on Lollipop device it does not work. Anybody knows how to solve it. Hi this is because in lollipop if you have disabled Auto - Capitalization in keyboard settings then you can't enable it programmatically. here are the steps:- Tap icon of ‘Settings’ on the Home screen of your Android Lollipop Device At the ‘Settings’ screen, scroll down to the PERSONAL section and tap the ‘Language & input’ section. At the ‘Language & input’ section,

How to check if an activity is locked (app pinning) in android Lollipop

让人想犯罪 __ 提交于 2019-12-05 01:02:48
I would like to know whether an activity is locked under app pinning in android 5.0 and above programatically. Please help me in this! Thanks! Sarangan Method to get if the activity in lock task mode. activityManager.isInLockTaskMode() API is deprecated in API level 23. Use the method activityManager.getLockTaskModeState() http://developer.android.com/reference/android/app/ActivityManager.html#getLockTaskModeState() public boolean isAppInLockTaskMode() { ActivityManager activityManager; activityManager = (ActivityManager) this.getSystemService(Context.ACTIVITY_SERVICE); if (Build.VERSION.SDK

List of default apps showing wrong in Android L

谁都会走 提交于 2019-12-05 00:43:05
I want to get all default apps in Android L. I used bellow code but they give me a wrong solution. Let see my code first private void getMyAppLauncherDefault() { final IntentFilter filter = new IntentFilter(Intent.ACTION_MAIN); filter.addCategory(Intent.CATEGORY_HOME); List<IntentFilter> filters = new ArrayList<IntentFilter>(); filters.add(filter); List<ComponentName> activities = new ArrayList<ComponentName>(); final PackageManager packageManager = (PackageManager) getPackageManager(); packageManager.getPreferredActivities(filters, activities, null); for (ComponentName activity : activities)

SyncAdapter vs JobScheduler

末鹿安然 提交于 2019-12-05 00:40:55
Excluding the fact that JobScheduler only supports API > 21 - are JobSchedulers designed to fully replace SyncAdapters ? Or does SyncAdapter contain any functionality lacking by JobScheduler ? My use case is syncing an RSS feed every couple of hours. This is doable with a JobScheduler - right? I would say JobScheduler is not a direct substitution for SyncAdapter , which has a much more specialized purpose (transferring data between the device and a server). JobScheduler , on the other hand, serves to schedule tasks to be executed at some point of time in future - just like AlarmManager - but

Android app time delay on 5.0+ devices

ぃ、小莉子 提交于 2019-12-04 23:32:31
My app is taking 10-12 sec delay while first load on 5.0+ devices, 4.4 or below devices does not have this problem. I have added a log message in Application class onCreate method but it is also called after 10-12 sec seconds. I have tried multidex enable false, minify enabled true but does not make any difference. I have found one thing, when we clear cache and data from app info activity, then it again delay while loading and my app is taking around 10mb of cache and 5 mb of data which is higher than usual. How to address this problem? I have not find this type of issue on net or