android-5.0-lollipop

Change adaptive brightness level programmatically

 ̄綄美尐妖づ 提交于 2019-12-08 06:01:05
问题 How can I change the adaptive brightness level programmatically, on Android Lollipop? I know how to change the manual brightness level , and to toggle on or off the adaptive brightness . It is done like that: Settings.System.putInt(cr, Settings.System.SCREEN_BRIGHTNESS, newLevel); However, with adaptive brightness is enabled, the OS combines it with another brightness level which is different than the manual one. Is there a way to do this? Target/min/max SDK is 21. 回答1: Don't know why but

Notification icon on status bar is coming as white box

感情迁移 提交于 2019-12-08 05:57:50
问题 How do i customize the notification icon on the status bar in my phone running Android 5.0. It always comes as a white box(image attached). The notification icon in the notification bar comes colorful as expected but the status bar icon comes as white square box. l 回答1: android 5.0 uses the icon that you give him and puts a color filter on it. If you want to see your icon, you must use an icon with transparency (png). I advice you to set another icon other than the icon of your application

Corrupted decoding of a video using MediaCodec in Android 5+

笑着哭i 提交于 2019-12-08 05:40:08
问题 Simply trying to decode frames from videos. While working with Android 4+ (<5), it worked just fine. I'm using parts of the example that can be found here: http://bigflake.com/mediacodec/ "ExtractMpegFramesTest.java (requires 4.1, API 16)" The problem is - it extracts a frame, but the result Bitmap is as can be seen here (Saved an image right after decoding it): The real video of course has "real" frames, and not "stretched" 1 column. I've saved this image right after the code line: bmp

Android Lollipop camera issue

落爺英雄遲暮 提交于 2019-12-08 04:42:45
问题 My android application was working fine on all android devices from version 2.3 to 4.4. However, when i updated my Samsung Galaxy S4 to LOLLIPOP and tested the said app, there are a few errors in functionalities such as camera,map etc. Below is the code snippet used in my application to utilize the native camera: protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult( requestCode, resultCode, data); if (requestCode == CAMERA_REQUEST &&

Install Apps from unknown sources inside work profile in Android Lollipop 5.0.1

僤鯓⒐⒋嵵緔 提交于 2019-12-08 03:56:41
问题 Question is related to Work Profile in " Android for work " . I have written a sample app that creates a managed work profile and sets itself as the profile owner . I will need to push some enterprise applications through the profile owner . So when i try to install , it says "Install blocked" , Cannot install from unknown sources . If i toggle the button ( Setting->security->Unknown Source ) on and off , settings are not getting reflected in the work profile. Is there a way to install the

Device Owner without using NFC in Android Lollipop

喜你入骨 提交于 2019-12-08 02:56:20
问题 I want to make my app as Device Owner without using NFC. On developer blog it's mentioned that to make device owner you must use NFC but I found it is also possible without NFC as mentioned by alex_au in this comment. I have tried this but haven't been successful. Has anybody been able to accomplish this? 回答1: You can use command line tool dpm from adb shell. Usage: usage: dpm [subcommand] [options] usage: dpm set-device-owner <COMPONENT> usage: dpm set-profile-owner <COMPONENT> <USER_ID> dpm

Spinner adapter issue in Android 5.0

自作多情 提交于 2019-12-08 01:06:30
问题 My app is not compatible with Android 5. When I run it in any other version it works with no issues. This is what appears in the logcat when run it in Android 5: 05-16 23:44:10.287 1969-1969/com.barakah.camel E/AndroidRuntime﹕ FATAL EXCEPTION: main Process: com.barakah.camel, PID: 1969 java.lang.IllegalArgumentException: Spinner adapter view type count must be 1 Here's where the problem lies based on the logcat: public void regionSpinnerSetup() { ParseQueryAdapter.QueryFactory<ParseObject>

UnsatisfiedLinkError when compiling with API21

拈花ヽ惹草 提交于 2019-12-08 00:44:25
问题 My project uses NDK r10d for the c++ code. When I compile the project with API19 it works great, but when I compile it with API21 it crashes on runtime. When the c lib is loaded I get: dlopen("/data/app-lib/com.my.app-2/libMyCode.so") failed: dlopen failed: cannot locate symbol "stpcpy" referenced by "libMyCode.so"... Then it crashes on: java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "stpcpy" referenced by "libMyCode.so"... I use OnePlus One running Android4.4.4 to test

how to gradually turn transparent action bar into solid color as user scrolls down

两盒软妹~` 提交于 2019-12-07 22:56:31
问题 In recent android L apps ( lets say google i/o 2014 app) with material theme we have seen that if there is image view at top (followed by any kind of list), then to begin with the actionbar is transparent, then as the user scrolls down the actionbar gradually becomes solid color. 2 questions: 1. does this phenomenon have some name, if yes what is it? 2. how do i code to achieve this in an app for android L or is it default 回答1: take a look here : https://github.com/ManuelPeinado

Change the pressed color of action bar item of Lollipop action bar

夙愿已清 提交于 2019-12-07 20:28:37
问题 I am using AppCompat and have successfully implemented the new action bar that rolled out with lollipop. The only problem is the pressed background color of the action items. I want to show a different background color for the action item when pressed. Any idea how it can be done? 回答1: You have a couple of options. But first, some background: The action items in AppCompat use theme attribute ?attr/actionBarItemBackground (see res/values/styles_base.xml) which is set to ?attr