android-5.0-lollipop

Solving Rendering Artifacts in Frame Buffer with WebView and EditText on Android 5.0?

会有一股神秘感。 提交于 2019-12-24 12:08:03
问题 After upgrading Nexus 5 to Android 5.0, an activity with default focus on an EditText does not render correctly (EditText repeats down across the screen with grey dots in between and if you click again or dump the ViewHierarchy with UiAutomator, it will return to normal rendering). (I would upload the image, but don't yet have reputation for images). NOTE: This is ONLY after I have loaded a WebView within the application (though in a separate activity). The same screen renders correctly prior

Android L Raised Normal Button

﹥>﹥吖頭↗ 提交于 2019-12-24 11:39:22
问题 I've been hunting high and low for a way to get a "raised" rounded rectangular button without completely doing it myself using backgrounds and a custom view. I want buttons like this: I thought this would do it: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen

ADT v23 + SDK 23 - Android “L” - missing Proguard?

∥☆過路亽.° 提交于 2019-12-24 11:29:52
问题 Recently I've updated to the newest Android "L" SDK versions (and the ADT plugin of course). I've updated my app and wanted to export it, and then got this old, known message : invalid proguard configuration file path I remembered I had a similar problem before, and went back to it here. Indeed, I had the missing variable for some reason. However, I still got the same error. Then I went to the ".../tools" folder of the sdk , and didn't find any proguard file/folder. I've tried to re-install

Android L - Take flash image with autofocus using Camera2 api

微笑、不失礼 提交于 2019-12-24 10:35:29
问题 Following camera2basic guide on Android L preview page, I am able to capture normal images, i.e. without flash or using auto-focus mechanism (I rely on passive focus) However, I would like to take a flash image. The documentation states before taking flash image, I should call android.control.aePrecaptureTrigger to determine correct exposure. My question: How can I call AE Precapture trigger, wait for it to complete and then take the image using capture(CaptureRequest, CameraCaptureSession

Count how many times every app is used in one day using UsageEvents, UsageEvents.Event and MOVE_TO_FOREGROUND

懵懂的女人 提交于 2019-12-24 09:31:18
问题 With UsageStatsManager and UsageStats I'm able to obtain the daily usage (in houres, minuts and seconds) of every app on my smartphone. Now I want to know if there is a way to obtain the daily frequency of use (in numbers of times, i.e. 1 times, 2 times, etc) of every app on my smartphone. Reading the documentation I deduced that this could be achieved using UsageEvents, UsageEvents.Event and MOVE_TO_FOREGROUND. So I wrote the following code: // Get the app statistics since one day ago from

How to get internet to work in Android TV emulator

牧云@^-^@ 提交于 2019-12-24 04:48:08
问题 I have an Android TV (not google TV) emulator setup running android tv 5.0 and it has no access to the internet. In settings for both wifi and ethernet it says "no connection". Is there something I am missing? I have emulators for other versions of android running on phones and everything networking wise works ok. Also I am not saying that my app has no internet access. I am saying that the actually Android TV settings says no network connections. 回答1: The Android SDK emulator images do not

Can't create a directory in external sd card (Lollipop)

元气小坏坏 提交于 2019-12-24 03:30:02
问题 I have no problem with internal storage but I want to create a directory on the external SD card, with versions prior to KitKat, File.mkdirs() works. There is part of my code: //external sd card DocumentFile.fromFile(new File("/storage/sdcard1/")).exists(); //returns true DocumentFile.fromFile(new File("/storage/sdcard1/")).canRead(); //returns true DocumentFile.fromFile(new File("/storage/sdcard1/")).canWrite(); //returns true DocumentFile.fromFile(new File("/storage/sdcard1/test")).exists()

Android how to create ripple effect in Java

走远了吗. 提交于 2019-12-24 02:09:51
问题 I have the ripple xml. But I am not sure how to get same effect in Java. <ripple xmlns:android="http://schemas.android.com/apk/res/android" android:color="@color/blue_1" /> I would like to define / create / load a ripple, or even set a color in Java. That means, in java, I can load the XML ripple, then assign a color. or can i do do everything in java: Ripple = new Ripple ? I tried the code from this link: https://github.com/romainguy/google-io-2014/blob/master/app/src/main/java/com/example

How to get absolute paths in the removable SD-card using Storage Access Framework (SAF)?

会有一股神秘感。 提交于 2019-12-24 01:25:16
问题 Is there any way to get the absolute path from specific Folders & Files located in the removable SD-card, using the Storage Access Framework (SAF)? Thanks 回答1: No, and even if you could, you would not be able to access them, unless they happened to be in one of the couple of locations on removable media for which you have read access (e.g., getExternalFilesDirs() ). The Storage Access Framework returns Uri values pointing to documents. Use ContentResolver and methods like openInputStream() to

Android Detect Flag Emojis Present

馋奶兔 提交于 2019-12-24 01:17:11
问题 It was my understanding that as of Lollipop (Android 5.0), the flag emojis would be included. I have a Google Nexus device and a Samsung Galaxy Note 4, and the Nexus has the emojis while the Samsung just shows the two letter country code. Is there anyway to detect if the flag emojis are supported so I could just hide the country codes if the emoji flags aren't there? 来源: https://stackoverflow.com/questions/36780166/android-detect-flag-emojis-present