android-5.0-lollipop

Path.approximate() not supported on android studio 0.8.14 beta

若如初见. 提交于 2019-12-23 07:12:12
问题 Rendering Problems Path.approximate() not supported. Failed to parse file ~\sdk\platforms\android-21\data\res\drawable\progress_medium_material.xml error after add ProgressBar to Layout How to resolve? 回答1: You can also switch rendering theme to Theme.Black and pick API 20 version to render layouts in Android Studio. 回答2: It seems to be a bug in the appcompat-v7:21.+ https://code.google.com/p/android/issues/detail?id=77865 I've changed compileSdkVersion and targetSdkVersion in my app's build

setOnEditorActionListener is not working for Android Lollipop

喜欢而已 提交于 2019-12-23 03:40:59
问题 I have been trying this IME_ACTION //Listening to the keyboard action mSearchEditText.setOnEditorActionListener(new TextView.OnEditorActionListener() { @Override public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { if (actionId == R.id.ime_search || actionId == EditorInfo.IME_ACTION_SEARCH) { performSearch(); return true; } return false; } }); but seems like it doesn't at all work on Lollipop devices. Here is the XML code - I am completely sure that I am doing this right.

Android L — Play Ripple Effect on View

一个人想着一个人 提交于 2019-12-22 13:59:06
问题 I am trying to play a ripple effect (from Android L) on a view at a certain time (not on the view being touched). To be specific, when the user successfully changes some text, I want a certain view to play a green ripple effect to show success. Is there any way to do this? I have tried putting a RippleDrawable in an Animation, putting the RippleDrawable as the background for my "success view." But, I can't figure out how to play the ripple animation as I have described. P.S. My project is

Android get UsageStatsManager in API level 21

孤人 提交于 2019-12-22 11:09:12
问题 I need to get info about recent apps usage. Before API 21 it was used getRunningTasks or getRecentTasks to get this info. These methods were deprecated in API 21 according docs. There is UsageStatsManager class now, introduced in API level 21. But! Context.getSystemService(UsageStatsService) was added only in API level 22! The question is - how to get needed data in API 21 ?? According dashboards, there is 13% of users at this API level, I don't wanna lose them. 回答1: Well Context

Android 5 screen glitch/static with Google Maps Fragment inside a Viewpager

◇◆丶佛笑我妖孽 提交于 2019-12-22 10:34:29
问题 I am having a strange issue related to Android 5 and Google Maps combined with a Viewpager and Fragments, hoping to get some good ideas from all of you.. Screenshot of the problem: http://postimg.org/image/6wzssbdbr/ (no rep for inlining yet) Situation: Main Activity with a Viewpager that has a number of Fragments One of the Fragments has a MapView inside it with all lifecycle methods forwarded; replace MapView with MapsFragment and the issue is the same Open a new Activity, as long as the

Jobscheduler API android L

纵然是瞬间 提交于 2019-12-22 08:35:06
问题 I am making an application that makes use of the jobscheduler API. I want to run a service periodically and when the device is charged. This is the code. JobInfo.Builder builder = new JobInfo.Builder(kJobId++, mServiceComponent); builder.setRequiredNetworkType(JobInfo.NETWORK_TYPE_ANY); builder.setPeriodic(3000); builder.setRequiresCharging(true); mTestService.scheduleJob(builder.build()); Now when I run this and I unplug the device, the service still runs after 3 secs. There is no effect of

how can i show icon app in Lollipop Toolbar?

大城市里の小女人 提交于 2019-12-22 06:38:14
问题 I am missing an app icon after switching from ICS ActionBar to Lollipop toolbar . Is it possible? Please help me. Thanks mDrawerToggle.setDrawerIndicatorEnabled(false); 回答1: The use of application icon and a title is discouraged on API 21,according to Material Design. Anyway if you want to use an icon, you can use the setLogo method in your Toolbar. 来源: https://stackoverflow.com/questions/27768109/how-can-i-show-icon-app-in-lollipop-toolbar

Android: unable to change color of back arrow navigation icon

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-22 06:37:39
问题 I'm using new android appcompat toolbar. I need to set the same custom color to both burger icon and back arrow icons. Using drawerArrowStyle allows me to change burger icon but not the arrow. The issue is only on Lollipop devices, anything pre-lollipop is fine. Here is the code: Toolbar: <?xml version="1.0" encoding="utf-8"?> <android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android" xmlns:local="http://schemas.android.com/apk/res-auto" android:id="@+id

Android Lollipop becoming device admininistrator doesn't work

可紊 提交于 2019-12-22 06:36:53
问题 I'm following this guide on how to have my app request to become a device administrator. This works great on any 4.x android versions with any phone, but doesn't work on Lollipop (I've tried on a Nexus 5 and on a Nexus 7). Logcat shoes the following error: *11-02 07:37:09.649: W/DeviceAdminAdd(10020): Cannot start ADD_DEVICE_ADMIN as a new task* Has anyone else come across this problem with Lollipop? What can be the cause? I've gone over all parts of the guide and made sure my XML, menifest,

How do i remove a foreground notification in Android Lollipop?

痴心易碎 提交于 2019-12-22 05:07:34
问题 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