Tag: android-5.0-lollipop

Android: Ratingbar not visible, becomes visible only on touching

In my Android app, ratingbars are not visible. It only becomes visible only on touching it and disappears as soon as I take my fingers off. My code: <RatingBar android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:id=”@+id/myratingStars” android:layout_gravity=”center_horizontal|center_vertical|center” android:numStars=”5″/> It does not render in Lollipop emulator/real phone/Android Studio design window(in API 23 mode) but gets rendered in KitKat emulator and […]

Screen pinning 3rd party apps programmatically

After achieving device ownership, I am trying to implement a method to instruct the device to lock any given app into kiosk mode (or screen pinning mode). Since I have device ownership, the user is not asked for the permission to do so. From the developer website, brief description tells me that it is possible […]

BLuetooth Gatt Callback not working with new API for Lollipop

I currently have a method which writes to the BLE devices to beep it. My Bluetooth Callback goes as follows : ReadCharacteristic rc = new ReadCharacteristic(context, ds.getMacAddress(), serviceUUID, UUID.fromString(myUUID), “”) { @Override public void onRead() { Log.w(TAG, “callDevice onRead”); try{Thread.sleep(1000);}catch(InterruptedException ex){} WriteCharacteristic wc = new WriteCharacteristic(activity, context, getMacAddress(), serviceUUID, UUID.fromString(myUUID), “”){ @Override public void onWrite(){ […]

Android lollipop shared elements transition blink / flash

I see strange thing in my shared element transition on Lollipop. Shared elements are flickering just before they are starting to animate (please see video https://www.youtube.com/watch?v=DCoyyC_S-9A) I’ve no idea why it is happening. However when I add <item name=”android:windowSharedElementsUseOverlay”>false</item> to my theme I don’t see flickering but the transition is not looking good (they look […]

scheme host not working on android lollipop, click on link to open app

I am using this piece of code to launch my app from a link. <activity android:name=”com.example.myApp.myClass” android:label=”@string/app_name” > <intent-filter> <data android:host=”customHostName” android:scheme=”customScheme” /> <action android:name=”android.intent.action.VIEW” /> <category android:name=”android.intent.category.BROWSABLE” /> <category android:name=”android.intent.category.DEFAULT” /> </intent-filter> </activity> This is href link, i want to get the key in the end. customScheme://customHost/49FYTJTF00 It is working fine on all previous […]

How to get running application activity Name in android 5.0(L)?

I am using the following code to get the current running activity name in android. ActivityManager am = (ActivityManager) aContext .getSystemService(Context.ACTIVITY_SERVICE); List<ActivityManager.RunningTaskInfo> alltasks = am .getRunningTasks(1); ComponentName componentInfo = alltasks.get(0).topActivity; componentInfo.getClassName(); System.out.println(“Current:”+componentInfo.getClassName()); This is working fine in all the versions below android 5.0. But in Android 5.0 it always returning the launcher activity. Please any […]

Shared Element Transitions Between Views (not Activities or Fragments)

Let’s say I’m using a view-based approach to develop an Android application like for example described in the following article: http://corner.squareup.com/2014/10/advocating-against-android-fragments.html So now I have two full screen views. One is visible and contains a grid of images. The other is hidden and is a detail view of the to-be-clicked image. Without transitions on clicking […]

Android 5.0 emulator showing Storage space running out

I just updated Android SDK to version 21 and trying to start emulator. I am using Nexus 4 with CPU Intel atom (x86) 768 RAM and 524 internal storage. Emulator starts fine but it shows en error message, “Storage space running out” and it is very slow. I tried increasing the RAM also but didn’t […]

NullPointerException in IabHelper.queryPurchases

Today I discovered an application crash report for my Android app involving the following stack trace: java.lang.NullPointerException: Attempt to invoke interface method ‘android.os.Bundle com.android.vending.billing.IInAppBillingService.getPurchases(int, java.lang.String, java.lang.String, java.lang.String)’ on a null object reference at com.myapp.utils.IabHelper.queryPurchases(IabHelper.java:878) at com.myapp.utils.IabHelper.queryInventory(IabHelper.java:572) at com.myapp.utils.IabHelper.queryInventory(IabHelper.java:545) at com.myapp.utils.IabHelper$2.run(IabHelper.java:645) at java.lang.Thread.run(Thread.java:818) (line numbers are changed from the original -or what looks like to be […]

application content goes behind the navigation bar in android L

As you can see my “Got It” button is behind the navigation bar.Not able to fix it!!! I have tried <item name=”android:fitsSystemWindows”>true</item> As well as setting it in layout file. my theme in value-21 is : <style name=”AppTheme” parent=”android:Theme.Material.Light.NoActionBar”> <item name=”android:windowNoTitle”>true</item> <item name=”android:windowActionBar”>false</item> <item name=”android:windowFullscreen”>false</item> <item name=”android:windowContentOverlay”>@null</item> <item name=”android:fitsSystemWindows”>true</item> </style> Its the same case with […]

Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.