android-5.0-lollipop

Media Session Compat not showing Lockscreen controls on Pre-Lollipop

ⅰ亾dé卋堺 提交于 2019-12-20 08:36:48
问题 I'm using MediaSessionCompat from AppCompat Support Library Revision 22. And on Lollipop I'm getting notification & also the background of lockscreen is the album art. And everything works cool. While on Pre-Lollipop devices, the music controls on lockscreen are not at all shown. It's weird & I tried everything but it doesn't show up, not even the background changes. I hope someone has solution to this issue. Note: RemoteControlClient used to work on Lollipop & KitKat /** * Initializes the

How to perform notification-action (click) on lock-screen?

巧了我就是萌 提交于 2019-12-20 08:36:24
问题 TL;DR How can I make a notification that does some work from the lock-screen without unlocking? After clicking an action, a button on the notification or just the complete notification, I want to do an API call (without typing my unlock code) Details Goal Based on the answer on this question I tried to make a notification with an action that works on the lockscreen without unlocking the device. The action is something that doesn't need any further interface or interaction (think 'send an API

Android L - Material design on SwipeRefreshLayout color scheme

谁都会走 提交于 2019-12-20 08:27:28
问题 I´m starting to implement the Material Theme on my newest project, preparing it for the launch of the new L version. I´ve been reading the Material design guidelines and found this. UI Color Application Choose your palette Limit your choice of colors by choosing three color hues in the primary and one accent color in the secondary palette. The accent color may or may not need fall back options More or less it explains how to implement those hues on the app, including the accent color but when

SVG/VectorDrawable issue in android

a 夏天 提交于 2019-12-20 05:41:14
问题 I have used svg files in my Android project. There are issues in Android 4.4 or lower versions. I have tried these solutions app:srcCompat , vectorDrawables.useSupportLibrary = true in gradle file and AppCompatDelegate.setCompatVectorFromResourcesEnabled(true); in static block of BaseActivity . Other than gridview, images are not shown in app . 回答1: Instead of using above 3 solutions, just replace your ImageView with android.support.v7.widget.AppCompatImageView . No need to do any extra

Android status bar tints from kitkat to lollipop

偶尔善良 提交于 2019-12-20 05:34:08
问题 I'm trying to implement the nice status bar for my app and have successfully achieved this on kitkat. This is the xml I'm using <?xml version="1.0" encoding="utf-8" ?> <resources> <style name="AppTheme" parent="AppTheme.Base"/> <style name="AppTheme.Base" parent="Theme.AppCompat.Light.NoActionBar"> <item name="colorPrimary">@color/colorPrimary</item> <item name="colorPrimaryDark">@color/colorPrimaryDark</item> <item name="android:windowBackground">@color/colorPrimary</item> <item name=

How do you un-provision a device in order to set the Device Owner?

早过忘川 提交于 2019-12-20 03:56:08
问题 'm trying to set up Device Owner using the sample apps downloadable from developer.android.com https://developer.android.com/samples/NfcProvisioning/index.html https://developer.android.com/samples/DeviceOwner/index.html But when I NFC tap the devices in the logcat for the device I am trying to set the Device Owner for I see this: /? E/ManagedProvisioning﹕ Device already provisioned. However I am doing a factory reset just before attempting the provisioning, so how can I get the device into

Android 5.0 (API 21) fails to render custom fonts / typefaces

北城余情 提交于 2019-12-20 02:05:54
问题 Android 5.0 seems to have trouble rendering custom fonts. This issue does not occur pre Android 5.0 and it does not occur in Android 5.1 (API 22). Here is an example using a font called "coaster", available here: http://www.dafont.com/coaster.font API 21: API 22: Any explanation for this? 回答1: Google has acknowledged that this was an issue in Android 5.0, and has fixed it in Android 5.1: https://code.google.com/p/android-developer-preview/issues/detail?id=608&thanks=608&ts=1404735239 As for

Camera2 API - Android

試著忘記壹切 提交于 2019-12-20 01:55:18
问题 I am trying to use new camera api provided by android as camera2. But CameraManager manager = (CameraManager) getActivity().getSystemService(Context.CAMERA_SERVICE); showing error. Does any one have worked on this api. Have been searching for results for could not find any thing yet. 回答1: Binod, That will only works if your platform support API level 21 - that is the one come after Android L release. For a detailed explanation of how camera 2 API works, you may want to take a look at this

Fatal Exception: NoSuchMethodError: No static method setOnApplyWindowInsetsListener

自古美人都是妖i 提交于 2019-12-20 01:14:20
问题 How I can fix this ? FATAL EXCEPTION: main Process: a6e69.materialdesigntest, PID: 1981 java.lang.NoSuchMethodError: No static method setOnApplyWindowInsetsListener(Landroid/view/View;Landroid/support/v4/view/OnApplyWindowInsetsListener;)V in class Landroid/support/v4/view/ViewCompatLollipop; or its super classes (declaration of 'android.support.v4.view.ViewCompatLollipop' appears in /data/data/a6e69.materialdesigntest/files/instant-run/dex/slice-internal_impl-24.2.0

Fatal Exception: NoSuchMethodError: No static method setOnApplyWindowInsetsListener

有些话、适合烂在心里 提交于 2019-12-20 01:13:04
问题 How I can fix this ? FATAL EXCEPTION: main Process: a6e69.materialdesigntest, PID: 1981 java.lang.NoSuchMethodError: No static method setOnApplyWindowInsetsListener(Landroid/view/View;Landroid/support/v4/view/OnApplyWindowInsetsListener;)V in class Landroid/support/v4/view/ViewCompatLollipop; or its super classes (declaration of 'android.support.v4.view.ViewCompatLollipop' appears in /data/data/a6e69.materialdesigntest/files/instant-run/dex/slice-internal_impl-24.2.0