FAQ Database Discussion Community


Crash: IllegalStateException: You need to use a Theme.AppCompat theme

android,android-studio,proguard,android-5.0-lollipop
I am getting a crash at startup when launching the activity. Stack Trace: main Process: com.haziqhussain.hazgames, PID: 10248 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.haziqhussain.hazgames/com.haziqhussain.hazgames.MainActivity}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity. at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2325) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387) ...

HttpURLConnection failes with NullPointerException on Lollipop

android-5.0-lollipop,universal-image-loader,okhttp
I noticed that sometimes, not sure in which conditions, while downloading an image using Universal-Image-Loader (https://github.com/nostra13/Android-Universal-Image-Loader), I get the following NullPointerException: E/ImageLoader(27386): Attempt to invoke virtual method 'boolean java.lang.String.startsWith(java.lang.String)' on a null object reference E/ImageLoader(27386): java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.startsWith(java.lang.String)' on a null object reference E/ImageLoader(27386): at...

How to color the status bar with styles attributes in all Android versions?

android,android-5.0-lollipop,compatibility,material-design,android-styles
This is styles.xml <resources> <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"> <item name="colorPrimary">@color/primary</item> <item name="colorPrimaryDark">@color/primaryDark</item> <item name="colorAccent">@color/accent</item> <!-- Other attributes --> </style> While this is v21 styles.xml <?xml version="1.0" encoding="utf-8"?> <resources> <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"> <item...

Custom PagerTabStrip how to disable switching tabs via click - Not Working

android,android-layout,android-activity,android-5.0-lollipop,pagertabstrip
I want to disable the "switching tabs by clicking on tab name" of the PagerTabStrip based on a condition. I think the following code is right but I am still able to switch tabs by clicking on the tab names. I was able to disable the switching of tabs via...

Android Spinner not working on Samsung Devices with Android 5.0

java,android,spinner,android-5.0-lollipop
I'm using a custom Spinner widget with the code below. Everything works fine on most devices except on Samsung's devices with Android 5.0. On click the Spinner should display a list of values but that doesn't happen. On emulators and others brands devices with Android 5.0 it works fine. Has...

Font Boosting Issue in Android Lollipop

android,html5,android-5.0-lollipop,font-size
We recently noticed font boosting issue in Android Lollipop OS. If user modifies font size in settings Menu, application is reloading if it is already running and all fonts are modified based on selected font size in device settings. If we are setting below metatag viewport, issue is not exist...

Fragment Transitions: shared elements

java,android,animation,android-5.0-lollipop,android-transitions
easiest way to show you what I'm trying to achive is this video: shared image in fragment transition I have one activity and two fragments (FragA and FragB). Is there a way to do this kind of transitions on Android 5 without changing activity? Cheers...

how to show selection of the lst item in recycler view in android?

java,android,android-layout,android-5.0-lollipop,android-recyclerview
I have implemented the recycler view in navigation drawer in android.This is working fine.I am able to switch between item by clicking on recycler view item. but i am not able to change the background color for the selected item.please suggest me how to imeplement it.I have tried this so...

MATCH with selectArgs looking like *queryTerm* stopped working on Android 5.0+

android,android-sqlite,android-5.0-lollipop
This is addendum to my question SQLiteDatabase Cursor empty only on Android 5.0+ devices. That one will be closed as I was not sure what is causing the bug - thought it was a cursor note being properly filled. Now I have discovered what is causing empty cursor. Up to...

Circular Reveal Android Soften Edges

android-animation,android-5.0-lollipop,android-transitions,circularreveal
I'm just experimenting with the new Lollipop transitions and was curious if the following was possible. Right now I have a circular reveal animation working beautifully but it reveals the background with a very hard line. I was wondering if it was possible to soften the line or to fade...

Fix Device driver API match - Device driver API version: 23

android-studio,widget,android-5.0-lollipop
Error: 4761-4779/com.android.widgets E/﹕ Device driver API match Device driver API version: 23 User space API version: 23 4761-4779/com.android.widgets E/﹕ mali: REVISION=Linux-r3p2-01rel3 BUILD_DATE=Wed Oct 9 21:05:57 KST 2013 Devices: Samsung Galaxy N7000 XXLT9 Recovery: Rooted, PhilZ-cwm6-XXLT9-ORA-5.08.5 Rom: Nightowl-cm12.1-Beta4-n7000 Android: Lollipop 5.1.1 Kernel (Not touched): 3.0.64-Bauner-g8d135b8-dirty [email protected] #1 Microsoft Surface Pro Windows...

Dialog FLAG_DIM_BEHIND doesn't work on Android 5.x (Lollipop)

android,android-5.0-lollipop,android-dialogfragment
I dim the background of a DialogFragment using this code: Window window = getDialog().getWindow(); WindowManager.LayoutParams windowParams = window.getAttributes(); windowParams.dimAmount = 0.75f; windowParams.flags |= WindowManager.LayoutParams.FLAG_DIM_BEHIND; window.setAttributes(windowParams); This works fine on Kitkat and below, but stopped working on Lollipop. I suspect it has to do with the fact that my Activity is...

Set menu overflow icon to be white

android,android-5.0-lollipop,android-toolbar
I have a dummy app that I'm making just to get the hang of Android development. I managed to get a menu overflow icon to appear on my toolbar, but I can't seem to figure out how to change it to white. I'm using a Toolbar widget (without support libraries;...

ListView adds empty view to root/parent instead of self?

android,android-listview,android-5.0-lollipop
I'm trying to add a custom empty view to a ListView as shown in this Q&A. But the ListView seems to add the empty view to its parent, or maybe to the root ViewGroup, rather than to itself. Am I doing something wrong here? I created a small layout file...

RippleDrawable - Show Ripple Effect programatically

java,android,android-animation,android-5.0-lollipop,rippledrawable
I have a view with like this <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="New Button" android:id="@+id/button" android:background="@drawable/ripple" android:layout_centerVertical="true" android:layout_alignParentStart="true" /> And ripple.xml as <?xml version="1.0" encoding="utf-8"?> <ripple xmlns:android="http://schemas.android.com/apk/res/android" android:color="?android:colorControlHighlight" > <item android:id="@android:id/mask"...

Shared Element Transition Glitch in Android Lollipop

android,android-animation,android-5.0-lollipop,activity-transition,shared-element-transition
I'm trying to do an Android 5.0 shared element transition in a Master Detail situation from a ListView. I'm sending an Image. I've run into a glitch on the enter transition where the Image doesn't move at all while the Master activity transitions out. Once the Detail activity is loaded,...

Using Kit Kat DatePicker in Lolipop Device

android,android-5.0-lollipop,android-4.4-kitkat,android-datepicker,datepickerdialog
I'm trying to show a DatePickerDialog in my apps. But I realized that the DatePickerDialog that show up depends on the phone OS. My question is how can I show KitKat style DatePicker in Lolipop OS? I know this is possible because some apps like Facebook is using it. This...

What does TranslationZ actually do in Android?

android,android-5.0-lollipop,material-design
Hi I am developing android application in which I am trying to implement new material design features. I tried to apply both elevation property and TranslationZ property but it is not working. <Button android:id="@+id/button1" style="@style/ButtonStyle" android:layout_width="wrap_content" android:layout_height="wrap_content" android:clickable="true" android:text="Name" /> <?xml version="1.0" encoding="UTF-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <solid...

Android lollipop recieve media button actions from notification?

android,android-5.0-lollipop,android-notifications
I'm trying to create a notification that uses the media button actions, but how do I send and receive those buttons? Here is what I have so far... if(mediaSession==null) { mediaSession = new MediaSession(this, "Boom"); } //Album art ImageView img = (ImageView)findViewById(R.id.img_AlbumArt1); Bitmap bitmap = ((BitmapDrawable)img.getDrawable()).getBitmap(); PendingIntent mPauseIntent = PendingIntent.getBroadcast(this,...

Android: Using the ParcelFileDescriptor returned from UiAutomation.executeShellCommand() in InstrumentationTestCase

java,android,android-5.0-lollipop,android-uiautomator
I've written a generic shellCommand function for my InstrumentationTestCase subclass. The call to executeShellCommand works (the command is executed), but I'm doing something wrong with the returned ParcelFileDescriptor, because it seems to return rubbish. Here's my generic shellCommand function - public String shellCommand(String str) { UiAutomation uia = getInstrumentation().getUiAutomation(); ParcelFileDescriptor...

How to revert the behavior of dialogs and toasts?

android,xml,android-studio,android-5.0-lollipop,appcompat
I have the following problem: after an crash when resuming my VM suspended with AS open, the dialogs and Toasts now occupies the whole screen. Before, they were just a little box that appeared on bottom of screen. Now ProgressDialogs, dialogs and toasts have that all screen behavior I'm using...

Android ActionBar on Lollipop not styling correctly

android,android-5.0-lollipop,material-design,android-styles
I am designing an app with Material Design, but I am having trouble styling the ActionBar. First of all, I can not get the ActionBar to render a shadow. I have tried setting the elevation in multiple ways: In the styles.xml (v21): <item name="android:elevation">4dp</item> <item name="elevation">4dp</item> In the onCreate() method...

Android spinner- weird ui issue

android,android-spinner,android-5.0-lollipop,appcompat
I am using android spinner to show drop down options and i have customized its style and item style. It works fine but on lollipop it shows shadow like shown in the screenshot. spinner style is extended from the appCompat as below <style name="spinner_style" parent="Widget.AppCompat.Light.Spinner.DropDown.ActionBar"> and setting these properties <item...

Android: iBeacon - read its advertisement (e.g txPower)

bluetooth-lowenergy,android-5.0-lollipop,ibeacon,ibeacon-android
I have a problem here right now as I'm trying to read the tx-Power from my Onyx iBeacon. I've read multiple suggestions and tried so many code on the internet, but I still can't figure this out. I'm using android lollipop and tried the iBeacon tutorial from https://github.com/devunwired/accessory-samples/tree/master/BluetoothGatt for a...

Android Spinner Adapters and Lollipop

android,parsing,parse.com,android-5.0-lollipop,android-parsequeryadapter
Like many others, I'm using Parse.com in my android application. When I use a ParseQueryAdapter in a fragment to retrieve data and pass it to a spinner a java.lang.IllegalArgumentException: Spinner adapter view type count must be 1 and the application crash. I have searched for a fix and I know...

Android - Kill an app when screen turned off or screen times out

android,android-5.0-lollipop,android-4.4-kitkat
I want to kill / fully close an app so it doesn’t run even in the background when I press the screen turn on/off button or if the screen times out. I couldn’t find a solution anywhere on the internet. Can you guys help me out with a code snippet?...

Using Sliding Tabs with Toolbar

android,android-layout,android-5.0-lollipop,android-tabs,android-toolbar
I've started to change from using ActionBarActivity to AppCompatActivity, but I've also started using the Toolbar as well instead of a standard ActionBar. However, in one of my activities which has a swiping tab type of layout, the following line seems to be deprecated: actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS); Although I have looked at...

Throttling Brightness due to Thermal event in android

android,android-intent,android-activity,android-5.0-lollipop
Infrequently, My app will display an error message stating "Throttling Brightness due to Thermal event" There are no specific steps identified to reproduce this issue, although they seem to occur when working with my application. The error suggests that there could be a cpu spike or looped process, however this...

Maintaining backward compatibility with Material Design

android,android-5.0-lollipop,material-design,backwards-compatibility
I'm trying to implement an activity that has the Material Design tinted title bar. My standard style is: <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> </style> My v21 style is: <style name="AppTheme" parent=" -see rest of this post- "> <item name="android:colorPrimary">@color/primary</item> <item name="android:colorPrimaryDark">@color/primary_dark</item> <item name="android:colorAccent">@color/accent</item> </style> and the results I get are: API 18:...

Stylizing material buttons in Android v21

android,android-5.0-lollipop,android-button,material-design,android-theme
I am trying to maintain the material design ripple effect for devices with lollipop and above (21+) and stylize the button so that it doesn't have a large margin/space around it. Example 1: Buttons with ripple effect but with margin/gap: Example 2: Buttons with NO ripple effect and without the...

Android design support library with Theme.Material

android,android-5.0-lollipop,android-design-library,androiddesignsupport,material-theme
I would like to use the new design support library in my application beginning with the API 21. I want to use Theme.Material style but it's work only with Theme.AppCompat style. When I use Theme.Material, android return this error: error inflating class android.support.design.widget.textinputlayout" How can I resolve it ? Thank...

Logo disappear from toolbar after while

android,android-actionbar,android-5.0-lollipop,toolbar,android-actionbar-compat
When I install my app everything seems OK. But when I return after some moment there is no logo in my toolbar. There is only black. It was OK in Android 4.4, but my Galaxy S4 upgraded to Android 5.0.1 and there is this bug in my app. Don't you...

JobScheduler - Schedule Job At Device Bootup?

android,android-5.0-lollipop
Is it possible to schedule a job to begin at device bootup using JobScheduler? Or do I have to use BroadcastReceivers instead?...

HTC IR API Lollipop

android,android-5.0-lollipop,htc,infrared,ir
I am trying to get the infrared transmitter to work on the HTC ONE m8 after lollipop update. I am trying to use the HTC Sense IR SDK (addon-htc_ir_api-htc-19) found here: http://www.htcdev.com/devcenter/opensense-sdk/htc-ir-api I import the sample project (HTCConsumerIR) and run the app on my HTC device and the app simply...

Why is it possible on Android 5 (Lollipop) to directly change UI views from other threads?

android,android-5.0-lollipop
Consider the following code: new Thread() { @Override public void run() { myTextView.setText("Some text"); } }.start(); On pre-Lollipop androids, that code causes the CalledFromWrongThreadException exception, but why does it work fine on Lollipop androids? Testing environment: Genymotion emulator running Android 5.1 The code was inside the onCreateView() method of the...

Have a button execute OnClickListener on end of ripple animation(Material theme)

android,animation,android-5.0-lollipop
I'm observing a bug with ripple animation on a button in Android. Basically, I have a ViewGroup, call it ButtonContainer that contains 2 buttons, call them OkButton and CancelButton. When the user clicks on CancelButton, I want to hide ButtonContainer by setting it's visibility to GONE. But this is causing...

Bitmap decode issues with Android Lollipop

android,android-5.0-lollipop,bitmapfactory
I'm having problems when decoding imagens in Lollipop devices. The picture below shows a "testing app", that decodes 4 png files. Left = kitkat 4.4.4, Right = lollypop (5.0.1) Both in same device type: MOTO G 2nd Generation. Relevant Code: Options options = new BitmapFactory.Options(); options.inPreferredConfig = Bitmap.Config.ARGB_8888; options.inDither =...

Cocos2dx soundengine issue on Android Lolipop

android,cocos2d-x,android-5.0-lollipop,cocos2d-x-3.0,cocos2d-x-2.x
I am having an issue with Cocos2dx 2.2.6 on Android 5. After playing my game for a little while it starts to severely lag. This does not happen with Android 4. After doing some research many people have said it is a problem with Android 5 working with Cocos2dx's Audio...

How can I turn my makeSceneTransitionAnimation to a circle, and not rectangle?

android,android-5.0-lollipop,activity-transition,circularreveal
I am currently trying to create a circular transition between my FAB and another Activity. From what I understodd in the documentation, I should use makeSceneTransitionAnimation in a similar way to this: public void onFabClicked(View v){ try { Intent intent = new Intent(this, SearchActivity.class); ActivityOptions options = ActivityOptions .makeSceneTransitionAnimation(this, v,...

Support deprecated and new API

android,android-5.0-lollipop,deprecated
Is there any way I can support both deprecated and new API in the same method call for Android? I'm using the camera API which seems to be deprecated for the Lollipop version, so I tried to handle it like this: if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.LOLLIPOP) { //Before Lollipop, use the...

Android 5.0 Slide Animation Flashing fragment

android,android-fragments,android-animation,android-5.0-lollipop
I'm looking to use the Slide Transition class added in the Android SDK 21. Currently I have this code to replace my fragment: Fragment fragment = getFragment(fragmentManager); Slide slide = new Slide(Gravity.RIGHT); fragment.setEnterTransition(slide); fragmentManager.beginTrSlideansaction() .replace(R.id.content, fragment, getKey()) .commit(); The Slide animation works for the fragment coming into view, but the...

Failed to build android kernel

android,python,kernel,android-5.0-lollipop
I am trying to build the Android kernel for emulator. But the build failed. I am using the android-5.1.1-r1. Here are the error messages: mkdir -p /home/ying/WORKING_DIRECTORY/out/target/product/generic/obj/GYP/shared_intermediates/templates/org/chromium/base; cd external/chromium_org/base; python ../build/android/gyp/gcc_preprocess.py "--include-path=.." "--output=/home/ying/WORKING_DIRECTORY/out/target/product/generic/obj/GYP/shared_intermediates/templates/org/chromium/base/ApplicationState.java"...

Android ListView animation material deisgn

android,android-5.0-lollipop,material-design
in material design official guidelines I saw ListView animation - Video link My question: is it some build-in animation or I should manually code it to achieve same effect. If I should code it, which tools/classes are used for this?...

Does SQLCipher supports Android Lollipop?

android,android-5.0-lollipop,sqlcipher
Does SQLCipher supports Android Lollipop? As you can see in this link that it says SQLCipher for Android runs from 2.1 to 4.4. There is no mention of support of Android Lollipop (5.0).

Saving files to SD card on Android Lollipop

android,android-5.0-lollipop,android-sdcard,android-file,documentfile
Android 5 introduce new API for working with SD-card. If you want to write files into some directory on the SC-card, y need get access to it. As far as I know, it could be done in this way: Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT_TREE); startActivityForResult(intent, 42); and then: public void...

ImageView's scale type unexpected behavior

android,xml,user-interface,imageview,android-5.0-lollipop
I have an ImageView with scaleType="fitCenter" and layout_width="match_parent", so I expect the image inside it to scale and inflate all view. Layout file: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginBottom="20dp" android:layout_marginTop="20dp" android:gravity="center" android:orientation="vertical"> <FrameLayout android:layout_width="250dp" android:layout_height="wrap_content"> <ImageView...

Android Material xml Layout for Create Activity

android,android-5.0-lollipop,material-design,material,material-theme
I want some help please , i want to create activity for add information collected form user with material design like this images , I want flexible Space Same color like toolbar then and inside flexible space add project name and with Scroll view add all other things , please...

Android Camera2 getPreviewFrame

android,android-camera,android-5.0-lollipop
I am trying to get the camera frame in preview mode. I am running the sample project from github https://github.com/googlesamples/android-Camera2Basic The issue I am having is getting the frame in preview mode. Here is the code: private CameraCaptureSession.CaptureCallback mCaptureCallback = new CameraCaptureSession.CaptureCallback() { private void process(CaptureResult result) { switch (mState)...

RSA decrypt on android lollipop

ssl,rsa,android-5.0-lollipop,android-4.4-kitkat,public-key
I have an error with decryption with RSA. The code works on android 4.4 kit kat, but the same app doesn't work on android 5.0 lollipop. KeyFactory keyFactory = KeyFactory.getInstance("RSA"); RSAPublicKeySpec pubKeySpec = new RSAPublicKeySpec(new BigInteger(modulusBytes), new BigInteger(exponentBytes)); RSAPublicKey publicKey = (RSAPublicKey) keyFactory.generatePublic(pubKeySpec); byte[] decrypted = null; try { //...

Does going BW in low-bit mode in Android Wear actually save battery for ALL devices?

android,android-5.0-lollipop,android-wear,gameboy
I have an Android Wear watch face that I recently put on the Google Play store: https://play.google.com/store/apps/details?id=com.watchfuldesign.wearboy&hl=en I recently got this review: "Please add options to add a small day of month on the gameboy screen as well as not going black and white since that doesn't save battery for...

Android statusbar icons color

android,android-5.0-lollipop,android-styles,android-statusbar
I was wondering if it's possible to change the statusbar icons colour (not the statusbar colour, colorPrimaryDark) Let's say I want this statusbar with: <item name="colorPrimaryDark">@android:color/white</item> and the icons in black, is it possible? Thanks....

Android: Background Service to Simulate Touches in Any App Underneath a Window

android,touch,android-5.0-lollipop
I have a Service that can draw a Canvas on top of all applications using a SYSTEM_ALERT_WINDOW which contains a custom View. My Service and custom View both implement View.OnTouchListener The onTouch(View v, MotionEvent ev){} method of the Service returns true while the custom View returns false. This allows me...

Get rid of Android L automatic opacity tint when using windowTranslucentStatus = true

android,android-5.0-lollipop,android-4.4-kitkat,android-statusbar
Anyone know how to get rid of this automatic tint when you use windowTranslucentStatus = true? I already have status bar colour set to transparent but when I enable windowTranslucentStatus, it seems to override that. If I disable windowTranslucentStatus, then I get the desired status bar colour but I can...

AppCompatActivity crashed at startup on physical mobile devices but not Android emulators

android,android-5.0-lollipop,proguard,acra,appcompat-v7-r22.1
I got the following errors with the AppCompatActivity class: 06-08 06:32:47.441 E/ACRA (7296): java.lang.AbstractMethodError: abstract method "void r.b(java.lang.CharSequence)" 06-08 06:32:47.441 E/ACRA (7296): at r.a(Unknown Source) 06-08 06:32:47.441 E/ACRA (7296): at android.support.v7.app.AppCompatActivity.onTitleChanged(Unknown Source) 06-08 06:32:47.441 E/ACRA (7296): at android.app.Activity.onPostCreate(Activity.java:1197) 06-08 06:32:47.441 E/ACRA (7296): at android.support.v7.app.AppCompatActivity.onPostCreate(Unknown Source)...

Spinner adapter issue in Android 5.0

android,android-5.0-lollipop,android-spinner
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...

Unable to install apk using adb on device upgraded to Android Lollipop

android,adb,android-5.0-lollipop
I’ve recently upgraded one of my Android devices to Android Lollipop (5.0) and now I can’t debug my application and even install apk on the device using adb. I receive the following error java.lang.UnsatisfiedLinkError: No implementation found for java.lang.String android.os.SystemProperties.native_get(java.lang.St ring, java.lang.String) (tried Java_android_os_SystemProperties_native_1get and Java_android_os_SystemProperties_native_1get__Lj ava_lang_String_2Ljava_lang_String_2) at android.os.SystemProperties.native_get(Native Method)...

Replace Lockscreen Wallpaper in Lollipop 5.0.1

android,android-5.0-lollipop
I've recently upgraded my Samsung Galaxy S4 (i9505) LTE to Lollipop 5.0.1 and I've noticed there is nowhere to change the lockscreen wallpaper, so now I'm stuck with the chess-piece background that comes with the black edition BTU firmware that I've loaded onto the device. Is there anyway to change...

Android: status bar not theme on transitiong to new activity

android,android-activity,android-5.0-lollipop,statusbar
I have create a simple app with 2 activities. Main (launcher) activity is themed properly where colorPrimaryDark is applied to status bar. But when I transition to new activity, everything seems normal except status bar. It somehow colored white. Any idea why this could be happening? Running this on OnePlus...

YouTubePlayer together with AppCompat v7 library

android,android-5.0-lollipop,android-youtube-api,appcompat-v7-r22.1
I have developed an app that uses YouTube android API to play a certain video inside the app. At that time I have used as target API 19, and also target API 19. Now I want do change the design of the app switching to Material Design using target API...

ClassNotFoundException: Didn't find class “android.os.PersistableBundle” Otto Android 5.0

android,android-5.0-lollipop,classnotfoundexception,otto
I have a strange issue. I have an app which I deployed on an Android 4.4 device and use Otto library. I deployed the app on an Android 5.0 device. It still works. I retried on the 4.4 and the app won't launched. Apparently, it tries to use PersistableBundle.class which...

Very Beginner - How to include custom libraries from Github (FloatingActionButton) for Android

android,android-studio,android-5.0-lollipop,floating-action-button
I am very new at implementing custom libraries from github.com Here is the link I tried to follow: https://github.com/makovkastar/FloatingActionButton It seems easy to implement this floating action button, but I need someone to teach me how to follow this instruction. I get stuck here: 3) Attach the FAB to AbsListView,...

Android: Cannot read from external storage and cannot create folder in /storage/sdcard0

android,command-line,adb,android-5.0-lollipop,android-externalstorage
I have mounted an external ext4 hardrive from the device tree /dev/block/sda1 to /storage/emulated/legacy. My mainActivity is trying to access a file under /legacy/data/abc.txt. However it cannot get to it. The owner of /legacy/data is root. Also, mainActivity tries to create a folder under /storage/sdcard0/results called folderx using foldername.mkdir(), but...

Showing a menu overflow button in a Toolbar

android,android-5.0-lollipop,android-toolbar
I'm just messing around with Android and trying to learn stuff by building on a dummy app. I've created a Toolbar for Lollipop, but I can't seem to figure out how to add an overflow button to the toolbar. I'm not going to be using the v7 appcompat toolbar, as...

Xperia z1 compact Android Lollipop Unable to read from '/sys/class/leds/wled:backlight/max_current'

android,android-5.0-lollipop,sony,sony-xperia
After android 5 lollipop update I have a lot of error message on adb logcat console: 280-300/? E/leds-amami﹕ Unable to read from '/sys/class/leds/wled:backlight/max_current' from ps system 280 1 14284 1044 ffffffff 00000000 S /system/bin/illumination_service It is hard to develop on android with this message every 50ms Is there a solution...

Return type of CallStaticBooleanMethodV does not match Java method signature - Calling Java method from C/C++

java,android,c++,android-ndk,android-5.0-lollipop
My java method signature is - public static void JRequestRender() And in C/C++ void RequestRender() { ........... ........... jclass cls = env->GetObjectClass(g_JNIWrapperObj); jmethodID mid = NULL; if(cls) { mid = env->GetStaticMethodID(cls, "JRequestRender", "()V"); } if(mid) env->CallStaticBooleanMethod(cls, mid); env->DeleteLocalRef(cls); ..................... } This is working in all version of Android except Lollypop....

Switch control is not working on Dialog in Android version 5.0

android,android-layout,android-5.0-lollipop,android-switch
I have used below switch in my application. <Switch android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerHorizontal="true" android:text="" android:thumb="@drawable/toggle_button_color" android:textOff="@string/text_estimate" android:textOn="@string/text_accurate" android:textColor="@color/white" /> In above switch I am using toggle_button_color.xml to change the thumb color to green and red when switch is on and off respectively. <selector...

“You cannot install this app because another user has already installed an incompatible version on this device”

android,android-5.0-lollipop
Trying to install my own app from play store, it says "You cannot install this app because another user has already installed an incompatible version on this device" Note - I've uninstalled the debug version, and also cleared my Cache. Still can't get it to install from Play Store. My...

How to check if new songs have been added: Android API 21 only

android,android-5.0-lollipop,android-4.4-kitkat,music-player
Reference: In PlayMusic app as soon as a song is added the library is automatically updated even when the app is running. How can the same be implemented for building a new music player app? I am using MediaStore.Audio.Media to get the initial list of all the songs. ...

Appcompat v7 Material checkbox changing color to default black in Lollipop devices

android,checkbox,android-5.0-lollipop,material-design,appcompat-v7-r22.1
I am using appcompat v7 material checkbox. My project theme is light blue, so I am assigning light blue for my checkbox checked color in styles.xml as follows <!--checked color--> <item name="colorAccent">@color/light_blue</item> <!--un checked color--> <item name="android:textColorSecondary">@color/secondary_text</item> In My layout file <CheckBox android:id="@+id/chk_tick" android:layout_width="wrap_content" android:layout_height="wrap_content" android:button="@drawable/abc_btn_check_material"...

How to adjust Toolbar alignment?

android,android-layout,android-5.0-lollipop
I'm looking over design support library examples in the "Cheesesquare" demo of newer components I want to use. On my OnePlus One, the Toolbar is barely off-screen. I think CheeseDetailActivity.java, activity_detail.xml, and maybe styles.xml are pertinent here but I can't seem to make changes that correct the misalignment....

This Activity already has an action bar supplied by the window decor?

android,xml,android-layout,android-5.0-lollipop,material-design
I am developing an android app in matrial design.I am trying to use toolbar as the action bar of my app.but when run app i crasging & get the errror. Caused by: java.lang.IllegalStateException: This Activity already has an action bar supplied by the window decor. Do not request Window.FEATURE_ACTION_BAR and...

How to verify android device Screen ON or OFF using adb shell command in “Android 5.0.1 – Lollipop”

android,android-5.0-lollipop
Tried to check device Screen ON or OFF usingmScreenOn=true or mPowerState=SCREEN_BRIGHT_BIT. but following commands are not working in Android 5.0.1 – Lollipop. returning nothing Following commands working fine in Android - 4.3 Jelly Bean using input_method dumpsys adb shell dumpsys input_method | grep mScreenOn using power dumpsys adb shell dumpsys...

Localstorage data flush out when app kill in Android 5.0.2

android,cordova,local-storage,android-5.0-lollipop
I am working on cordova app which stored login details in localStorage so user not need to login again when he/she open app again. It's working with kitkat(4.4.4) and also working with lollipop(5.1) versions. But it's not working for lollipop (5.0.2). Can any give my guidance about this? I read...

Spinner malfunctioning on Lollipop

android,android-5.0-lollipop
My Android Project Build Target is 5.1.1 API 22 This app seems to work for every OS version except Lollipop. Lollipop restructures the height of some activities (negating the scrollable layout) as well as disrupts the spinners. Clicking a specific position on a spinner will input a different position in...

Translucent Status Bar on Kitkat, Tinted Status Bar on Lollipop

android,android-5.0-lollipop,statusbar,android-4.4-kitkat,material-design
I've searched for a solution, but haven't found one yet. I'm currently in the process of creating an Android app and my team wants to keep the experience of our app the same across the recent Android versions. We're using the Support v7 library, so most of the Material Design...

Android Emulator doesn't prevent external disk writing?

android,android-5.0-lollipop,android-4.4-kitkat
I'm confused with Android emulators. Either emulator for Android KitKat or Lollipop doesn't emulate external disk writing properly. Both of the Android versions are supposed to prevent applications to make modification on external disk (writing or modifying), even though the app has defined <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> I tried in Android...

animation-list not working in Android 5.0 (Lollipop)

android,animation,android-5.0-lollipop
I needed a simple animation which shows 3-dots loading. So I created 3 images, added it to animation list and set it to imageview. It was working fine till kitkat but after updating my OS to Lollipop, the animation doesn't seem to work. <animation-list xmlns:android="http://schemas.android.com/apk/res/android" android:oneshot="false" > <item android:drawable="@drawable/one_dot" android:duration="500"/>...

Button setText with Spannable dosen't work for Android 5.0 Lollipop

android,button,android-5.0-lollipop,spannable
I have simple Button: <Button android:id="@+id/test" android:textColor="@color/white" android:layout_width="wrap_content" android:layout_height="wrap_content" /> and try change text property by: SpannableString span = new SpannableString(text); span.setSpan(new AbsoluteSizeSpan(8, true), 5, 10, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); testButton.setText(span); It works with Android 4.3, but doesn't with 5.0. The interesting thing is when I change implementation from Button to TextView it...

Image data from Android camera2 API flipped & squished on Galaxy S5

android,android-camera,android-5.0-lollipop,galaxy
I am implementing an app that uses real-time image processing on live images from the camera. It was working, with limitations, using the now deprecated android.hardware.Camera; for improved flexibility & performance I'd like to use the new android.hardware.camera2 API. I'm having trouble getting the raw image data for processing however....

Android actionbar background same color as text

android,xamarin,android-actionbar,android-5.0-lollipop,android-theme
This is my first project working with Android (Xamarin) and i was trying to style the ActionBar. I succesfully changed the background color, but now the text within it is either gone or the same color as the background. I think the second because i only changed the background. Below...

Using Trust Agents in android app

android,android-service,android-5.0-lollipop,trust
I'm trying to use recently added TrustAgents. Manifest made by comments in official Android sources on Git. As there is said after implementing such manifest I will be able to extend classes from TrustAgentService. That's it: <uses-permission android:name="android.permission.CONTROL_KEYGUARD" /> <uses-permission android:name="android.permission.PROVIDE_TRUST_AGENT" /> <application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" > <service...

How to prevent Snackbar it from closing?

android,android-5.0-lollipop,material-design
I'm using a control, called Snackbar, from a 3rd party library - github.com/navasmdc/MaterialDesignLibrary. The problem is that it is closing automatically, like a Toast. What i am trying to do: It should stay until i click btn Code snippet i am using new SnackBar(ActSplash.this, "Do you want change color of...

Can't set AlarmManager to repeting one

android,service,alarmmanager,android-5.0-lollipop
I'm trying to set an Alarm to wakes up every 30s but it doesn't work. It does just 1 time at the beggining. I'm not sure if i've to use setInexactRepeating or setRepeating or setExact(and recall the method); and if i should use ELAPSED_REALTIME_WAKEUP or RTC_WAKEUP. public void onClick(View view)...

AlertDialog Buttons not wrapping in Lollipop

android,android-layout,android-5.0-lollipop,alertdialog
I'm a relatively new Android developer and have run into a problem that I don't really know how to correct and was hoping you guys might be able to advise! In Kitkat and below, when I create an AlertDialog that has 2 buttons, the text of both buttons would wrap...

How to change color of soft keyboard “Enter”/“Next” button on lollipop

android,android-5.0-lollipop,android-styles
Is it possible to change color of "Enter" button on soft keyboard in Android lollipop? I'd like this key to match my apps primary color....

get android.jar (API 21) artifact

android,maven,android-5.0-lollipop
I need to use Android API 21 (Lollipop) classes. I am using maven to build my Android project. I know I need to define dependency in order to build my project. So I defined the following one: <dependency> <groupId>com.google.android</groupId> <artifactId>android</artifactId> <scope>provided</scope> <version>4.1.1.4</version> </dependency> But the above latest artifact doesn't contain...

ImageView PNG is replaced by the default Android Icon on the Galaxy S5 Lollipop

android,android-5.0-lollipop
I have a very simple activity showing an image: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" > <ImageView android:id="@+id/my_image" android:layout_width="match_parent" android:layout_height="wrap_content" android:src="@drawable/activation_background" /> </RelativeLayout> my_image.png is only in /res/drawable-xhdpi/ and it is working fine for all the phones I've tried so far, except the Galaxy S5 with Lollipop (it is...

does the android webview version depends on the sdk or the device?

android,webview,sdk,android-5.0-lollipop,chromium
Android 5 is upgrading the WebView to Chromium 37. Does it mean I have to use the latest sdk for android 5 to enjoy the benefits, or the WebView will be automatically updated for the app once the user has been upgraded to android 5? What if I use android...

Android Push Notification sevice not start on Lollipop

android,push-notification,broadcastreceiver,android-5.0-lollipop
I am facing an issue while start service for push notifications. On Lollipop my app is crashing on start service for notifications receiver. I don't know how can I fix it. Can anyone help me for that. My start service code is. Intent registrationIntent = new Intent( "com.google.android.c2dm.intent.REGISTER"); registrationIntent.putExtra("app", PendingIntent.getBroadcast(this,...

Touch feedback on menu item with actionLayout

android,android-5.0-lollipop,android-menu,android-toolbar
I'm using a menu item with actionLayout because I need to add a textView along with my icon for the item on the ActionBar. everything shows up correctly but I don't know (and couldn't find anywhere) how to add the animation that shows up when user taps on a menu...

Cardview with dividers in it

android,android-studio,android-5.0-lollipop,android-cardview
I've seen those CardViews (I'm not sure they're even CardViews) with dividers used in a lot of apps, so I'm guessing there is an easy way to create them. I wanted to ask how is it exactly done? are those even CardViews? I couldn't find out more about them because...

RippleDrawable NOT drawing over Views

android,android-layout,android-5.0-lollipop,material-design
I have a layout with a KenBurnsView and an ImageView over it (just a toggle button). When I click on the button a Ripple is generated but is drawn below the KenBurnsView. Previously, when I had an Image view in replacement to the KenBurnsView the Ripple was drawn above the...

Phonegap scrolling issues on android 5

javascript,css,cordova,android-5.0-lollipop,phonegap-build
We are developing an app using Phonegap/Javascript. Scrolling used to work fine, until we tried the new Android 5. The page does not scroll down, unless you swipe many times. Then it is stuck in the other position.. Can't find anyone with this problem! We are using just simple divs...

SyncAdapter vs JobScheduler

android,android-5.0-lollipop,android-syncadapter,android-jobscheduler
Excluding the fact that JobScheduler only supports API > 21 - are JobSchedulers designed to fully replace SyncAdapters? Or does SyncAdapter contain any functionality lacking by JobScheduler? My use case is syncing an RSS feed every couple of hours. This is doable with a JobScheduler - right?...

Android Lollipop issues with text color

android,android-5.0-lollipop,android-theme,textcolor
I have an app with android:Theme.Holo, navigation bar with black background and white textcolor for Button/TextView. It's fine on OS before Lollipop. In Lollipop I can't see text, I suppose it's black too because, as I said, on previous OS it works fine. Any well-known issues about text color in...

How can I make the ripple effect look like a circle instead of an oval?

android,android-5.0-lollipop,material-design,rippledrawable
I have the same ripple effect on most of my image buttons and on most of them it looks like a circle when pressed but on some buttons it looks like an oval and I'm just not sure why it looks different. I realize the actual ripple shape is set...

size of button and edittext change with android API 21

android,android-5.0-lollipop
I'm developping an android application and it work fine with API 13 to 19, when i test it with API 21 the button size ,edittext and textview change (became bigger).i'm using (match_parent and wrap_content). i find in net that i should add these line android:textAllCaps="false" android:stateListAnimator="@null" but i have the...

(Partially Solved) ViewAnimationUtils - No animation occurs

android,animation,android-animation,android-5.0-lollipop,viewanimator
I'm trying to use a Circular Reveal to animate in a LinearLayout on click of a FAB. Onclick, the view changes to become visible after a time delay, but no visible animation runs? In addition, when the function is reversed as an exit animation the view is invisible for the...

android lollipop ViewGroup child hierarchy changes?

android,android-5.0-lollipop,viewgroup,android-5.1.1-lollipop
I have an app that has a minSdk of 15 and I'm working out all the bugs that came with the lollipop upgrade. Our software is very complex and it dynamically creates views using custom ViewGroups and then an array of elements that are explicitly sized and placed inside the...

Best way to check if Camera exists on Android device?

android,camera,android-camera,android-5.0-lollipop,cwac-camera
There is the cwac-camera library, there is also the android.hardware.camera that was deprecated in Lollipop. Now there is android.hardware.camera2. With andorid.hardware.camera, the solution was as simple as checking if Camera.getNumOfCameras() <= 0. I don't know the solution with android.hardware.camera2. I do have the cwac-camera library included in my project, but...