android-5.0-lollipop

java.lang.IllegalStateException: Unable to create layer for v

纵饮孤独 提交于 2019-12-21 03:25:51
问题 I have this exception on crashlytics and have no idea how to reproduce or what the cause might be. Does anyone have any pointers as to where I should start looking? Only affects Android 5+. Fatal Exception: java.lang.IllegalStateException: Unable to create layer for v at android.os.MessageQueue.nativePollOnce(MessageQueue.java) at android.os.MessageQueue.next(MessageQueue.java:323) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5585) at java

Android 5.0 emulator showing Storage space running out

半城伤御伤魂 提交于 2019-12-21 03:25:18
问题 I just updated Android SDK to version 21 and trying to start emulator. I am using Nexus 4 with CPU Intel atom (x86) 768 RAM and 524 internal storage. Emulator starts fine but it shows en error message, "Storage space running out" and it is very slow. I tried increasing the RAM also but didn't work. What could be the issue? 回答1: Open AVD Manager --> Wipe Data 回答2: You have to go in your android folder e.g. on OSX ~/.android/avd/{YOUR_AVD_NAME} and edit file config.ini. Just add or modify row

Media style notification not working after update to Android 5.0

佐手、 提交于 2019-12-21 02:27:28
问题 I tried implementing the Media Style Notification using this link. However when I recently updated to Android 5.0 SDK, the createSession method is not working. mMediaPlayer = new MediaPlayer(); mManager = (MediaSessionManager) getSystemService(Context.MEDIA_SESSION_SERVICE); mSession = mManager.createSession("sample session"); //shows compile error mController = MediaController.fromToken( mSession.getSessionToken() ); Is there any other method that needs to be used? When I checked the change

Camera2 API - How to set long exposure times

╄→尐↘猪︶ㄣ 提交于 2019-12-20 20:03:06
问题 I'm trying to capture images with 30 seconds exposure times in my app (I know it's possible since the stock camera allows it). But SENSOR_INFO_EXPOSURE_TIME_RANGE (which it's supposed to be in nanoseconds) gives me the range : 13272 - 869661901 in seconds it would be just 0.000013272 - 0.869661901 Which obviously is less than a second. How can I use longer exposure times? Thanks in advance!. 回答1: The answer to your question : You can't. You checked exactly the right information and

Detecting Android L Battery Saver

拈花ヽ惹草 提交于 2019-12-20 19:56:30
问题 One of the new features of Android L is a battery saver that kicks in at 15%. Is there some way to detect when this is active, so my app will respond correctly? http://www.technobuffalo.com/2014/07/02/android-l-project-volta-battery-life/ I would like my app to get a callback from the operating system when the this mode is active so I can stop background services. If there is no callback, I could make a background process query for the battery level, but that seems wasteful. I also do not

RecyclerView + CardView + Touch feedback

萝らか妹 提交于 2019-12-20 10:24:22
问题 Has anybody solved the mystery of the CardView without touch feedback when it's inside a RecyclerView ? I have a RecyclerView with a bunch of CardViews (a CardList ). When I click on any CardView, I start another Activity. That's working pretty fine, but I can't see any touch feedback when I click on the CardView. Just in time, I've already configured my CardView (XML) with these: android:clickable="true" android:background="?android:selectableItemBackground" Thanks! 回答1: Background: The

Bug when listing files with Android Storage Access framework on Lollipop

安稳与你 提交于 2019-12-20 10:24:12
问题 Background I have a few apps that make heavy use of SD card for file syncing. The broken external SD card access on Kitkat is still a big problem, but I am trying to resolve this with the new API available on Lollipop for the users which have this. I successfully request and persist permission to SD card and I can list files in the root Uri returned from the grant permission activity. See more info on how this is done here: how-to-use-the-new-sd-card-access-api-presented-for-lollipop The user

onShowFileChooser() from android webview works only once

北城以北 提交于 2019-12-20 09:55:28
问题 I need to pick images from the device and upload it to the server. For the first time, when I pick the images, onShowFileChooser() gets called and everything works. But, when I try to click upload again, onShowFileChooser() never gets called. But it's working for non-lollypop devices. openFileChoser() gets called, whenever I click upload. Is there anything that I'm missing. Here is my code : //Needed for file upload feature vWebView.setWebChromeClient(new WebChromeClient() { // file upload

How to trigger ripple effect on Android Lollipop, in specific location within the view, without triggering touches events?

自古美人都是妖i 提交于 2019-12-20 09:46:20
问题 This is a short question: Suppose I have a View with the RippleDrawable as background. Is there an easy way to trigger the ripple from a specific position without triggering any touch or click events? 回答1: Yes there is! In order to trigger a ripple programatically you have to set the state of the RippleDrawable with setState() . Calling setVisible() does NOT work! The Solution To show the ripple you have to set the state to pressed and enabled at the same time: rippleDrawable.setState(new int

Lollipop AppCompat-v7 21 - Attribute “theme” has already been defined

余生颓废 提交于 2019-12-20 09:23:43
问题 I wanted to upgrade my project to support Android Lollipop and API 21, so I changed AppCompat version at the dependencies to 21.0.0, and my target SDK to 21. But now, When I'm trying to sync project with gradle files, it gives me 102 errors that weren't there before: 1 error of "Attribute 'theme' has already defined" - given by my colors.XML file, and another 101 errors of "no resources found that matches the given name..." - most of them are Material ones - given by "build/intermediates