android-5.0-lollipop

Tinting ImageView not working on Android 5.0. Ideas how to make it work again?

别来无恙 提交于 2019-12-06 20:56:37
问题 In an application I've built I noticed that the ImageViews are not tinted on devices running the new Android Lollipop. This is the code that used to work correctly on older versions of the OS: <ImageView android:layout_width="40dp" android:layout_height="40dp" android:layout_gravity="bottom|right" android:contentDescription="@string/descr_background_image" android:src="@drawable/circle_shape_white_color" android:tint="@color/intent_circle_green_grey" /> and this is the drawable that is loaded

Temporarily disable animation on Lollipop CheckBox

北城余情 提交于 2019-12-06 20:23:32
问题 I have a ListView with rows that include CheckBoxes. This ListView has filtering behavior attached, which recycles those rows by setting new data (via a simple setData() method) as the filter criteria changes. When this occurs, any recycled row that has the checked state changed will update its CheckBox, which in turn triggers the Lollipop animation of the CheckBox being drawn in or out. The ways in which this is distracting to the user are numerous. How can this animation be disabled

How to check if an activity is locked (app pinning) in android Lollipop

拟墨画扇 提交于 2019-12-06 19:34:39
问题 I would like to know whether an activity is locked under app pinning in android 5.0 and above programatically. Please help me in this! Thanks! 回答1: Method to get if the activity in lock task mode. activityManager.isInLockTaskMode() API is deprecated in API level 23. Use the method activityManager.getLockTaskModeState() http://developer.android.com/reference/android/app/ActivityManager.html#getLockTaskModeState() public boolean isAppInLockTaskMode() { ActivityManager activityManager;

Detect if resolution is too high on Android Lollipop

天大地大妈咪最大 提交于 2019-12-06 13:53:32
问题 I have to display some pictures in an ImageView. Some of them may have a resolution too high that gives me W/OpenGLRenderer﹕ Bitmap too large to be uploaded into a texture (3744x5616, max=4096x4096) I used this method to detect this situation: public boolean isResTooHigh() { int[] maxSize = new int[1]; GLES10.glGetIntegerv(GL10.GL_MAX_TEXTURE_SIZE, maxSize, 0); return (maxSize[0] < width) || (maxSize[0] < height); } where width and height are provided by the source of the pictures. But now on

Store video files on SD card in Android 5

折月煮酒 提交于 2019-12-06 12:24:58
问题 I'm recording video with the aid of android.media.MediaRecorder class, which accepts path string for output file (MediaRecorder.setOutputFile(String)), though there is a version of the method which accepts FileDescriptor . I need to store huge video files, so I want to use SD card. In order to get path to relevant directory I use Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM) . It turns out that resulting path is for the “emulated” storage ( /sdcard/… ) instead of

How to change DatePicker's CalendarView's background color in Lollipop?

牧云@^-^@ 提交于 2019-12-06 10:50:57
问题 I worked so hard to change the default background color of Lollipop's DatePicker. I cannot simply use Styleable attrs to change the default style. And as mentioned in another post, I can only use reflection to find the view, and then make changes on it. e.g. if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { int monthDayYearLayoutId = Resources.getSystem().getIdentifier("date_picker_month_day_year_layout", "id", "android"); if (monthDayYearLayoutId != 0) { View

Android MediaCodec API not working in Child Thread

徘徊边缘 提交于 2019-12-06 10:46:16
In Android, I tried using MediaCodec api (MediaCodecList.getCodecCount()) in Main Thread seems working fine with no issues. But the same api when i used inside its child thread , ends up with application crash. The crash log was stated below: A/libc(18571): Fatal signal 11 (SIGSEGV), code 1, fault addr 0xe0 in tid 18600 The above scenario was tested with Andriod 5.0.2 mobile device. Why such behaviour and any idea to resolve this ? 来源: https://stackoverflow.com/questions/32884208/android-mediacodec-api-not-working-in-child-thread

9Patch on Lollipop shows gray oval in background

坚强是说给别人听的谎言 提交于 2019-12-06 10:18:51
问题 I have the following button: <Button android:layout_height="32dp" android:layout_marginTop="4dp" android:layout_marginLeft="@dimen/aecs_item_inner_padding_positive" android:id="@+id/aecsTelephone" android:layout_width="wrap_content" android:layout_gravity="center_horizontal" android:layout_below="@id/aecsServicesContainer" android:layout_alignParentLeft="true" android:text="Mobile" android:background="@drawable/selector_mobile_button" /> and it has the following background selector: <?xml

Spinner adapter issue in Android 5.0

╄→гoц情女王★ 提交于 2019-12-06 10:13:06
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> factory = new ParseQueryAdapter.QueryFactory<ParseObject>() { public ParseQuery create() { ParseQuery

Lollipop notification background color

ぃ、小莉子 提交于 2019-12-06 08:51:28
I can't seem to make my notification use default notification background color: it remains gray where it should be white. At the same time, notification colors are appropriate in kitkat. I have implemented suggestions in this question There doesn't seem to be any effect on what I implement. The values-v21 simply acts as if it weren't there. Naturally, my target sdk is 21. I just can't seem to find the reason for this. The notification is displayed from service using StartForeground . I have also tried NotificationManager.notify() , but it makes no difference. Also, the notification is gray