android-5.0-lollipop

How do i remove a foreground notification in Android Lollipop?

我怕爱的太早我们不能终老 提交于 2019-12-22 05:07:27
问题 I'm looking to stop/dismiss a foreground notification for a service for a mediaplayer, much similar to Google's implementation for Google Music. For instance in Google Music, if you are playing music then the the notification cannot be swiped away. However if you pause the music it can. This is completely different to how it is implemented on Android 4.4, where the notification starts only when you leave the app and removes itself when you go back into the app. I can't see how to implement

Primary color (sometimes) goes transparent

偶尔善良 提交于 2019-12-22 04:38:05
问题 I am developing with the latest SDK version (API 21) and Support Library 21.0.2 and I've been having trouble when trying to implement the new Material Design guidelines. Material Design says that I need to have my primary color and my accent color and apply them over my app. But sometimes when I open the app the primary color becomes transparent in some widgets, it goes back to normal until I close the app (with the Back Button) and launch it again. Here is an example of the primary color

Lollipop EditBox styling

江枫思渺然 提交于 2019-12-22 04:14:12
问题 I currently have this one: Is it possible to remove black stroke and have only highlighted? Does it violate any Google guideline about material design 回答1: It is totally an android lollipop bug. It happens to the framework and AppCompat version of the EditText and will be fixed in a future release. See here: https://code.google.com/p/android/issues/detail?id=80180 来源: https://stackoverflow.com/questions/27123278/lollipop-editbox-styling

Shared element transition among fragments that belong to different activities in Android lollipop

大城市里の小女人 提交于 2019-12-22 04:01:58
问题 I have a shared element in a fragment that belongs to one Activity. I want to make a shared element transition in Android Lollipop with an element that is part of a fragment that belongs to another activity. Is it possible? How can I achieve that? 回答1: It's possible. First, when you detect in your fragment that transition is about to happen, build a array of Pair<View, String> which you populate with view and transition name. For example, if you want to animate from thumbnail image to full

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

瘦欲@ 提交于 2019-12-22 03:48:37
问题 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

MultiDex support in Android application error

强颜欢笑 提交于 2019-12-22 03:46:12
问题 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]:

List of default apps showing wrong in Android L

允我心安 提交于 2019-12-22 03:37:29
问题 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();

List of default apps showing wrong in Android L

こ雲淡風輕ζ 提交于 2019-12-22 03:36:28
问题 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();

SyncAdapter vs JobScheduler

大城市里の小女人 提交于 2019-12-22 03:25:48
问题 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? 回答1: 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

Android app time delay on 5.0+ devices

…衆ロ難τιáo~ 提交于 2019-12-22 01:32:41
问题 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