Tag: android-5.0-lollipop

Lint error with Fragments on Android L: “This method is not overriding anything”

This method is not overriding anything with the current build target, but will in API level 11 (current target is 1). How do I neutralize this error? The app compiles and runs. I’m using gradle: android { compileSdkVersion “android-L” buildToolsVersion “19.1.0” defaultConfig { applicationId “com.codepath.apps.restclienttemplate” minSdkVersion 14 targetSdkVersion “android-L” } …. } According to to […]

Make the navigation bar stay on top of any activity animation

First of all I’m working with the Android-L preview. Now, For anyone to not to misunderstand what navigation bar is, here’s a pic of it: https://imageshack.com/i/f0bjjDnQp I’m applying the activity animation that follows: activity.startActivity(intent); activity.overridePendingTransition(R.anim.slide_in_from_bottom, R.anim.scale_in); Where R.anim.slide_in_from_bottom.xml is: <?xml version=”1.0″ encoding=”utf-8″?> <set xmlns:android=”http://schemas.android.com/apk/res/android”> <translate android:duration=”300″ android:fromYDelta=”100%” android:toYDelta=”0%”/> </set> and R.anim.scale_in is: <?xml version=”1.0″ encoding=”utf-8″?> […]

Why do we need a 4th constructor for Lollipop?

I started a project targeting Android Lollipop (21), and created a custom view. When I generated constructors for the view, I got a new 4th constructor which takes more params than the others. public class FooView extends FrameLayout { public FooView(Context context) { super(context); } public FooView(Context context, AttributeSet attrs) { super(context, attrs); } public […]

Android Lollipop: ImageView ignoring fitsSystemWindows attribute (transparent status bar)

I’m currently working on an app for which I want to enable a transparent status bar. I want an ImageView (which I require for its scaleType attribute) to cover the entirety of the screen so that the image will show below the status bar. Here’s my layout: <android.support.v4.widget.DrawerLayout xmlns:android=”http://schemas.android.com/apk/res/android” android:layout_width=”match_parent” android:layout_height=”match_parent” android:fitsSystemWindows=”true”> <RelativeLayout android:layout_width=”match_parent” android:layout_height=”match_parent” […]

Listview scrolling bug on 5.1

Just noticed a very weird bug in ListView, seems reproducible only 5.1, and I really wonder how nobody brought it up already (couldn’t find anything related). Pretty easy to reproduce : Find a ListView with enough items (100 +) , scroll somewhere to the 3/4 of the list , now scroll up fast (2-3 long […]

Bug when listing files with Android Storage Access framework on Lollipop

Background I have a few apps that make heavy use of SD card for file syncing. The broken external SD card access on Kitkat is still a big problem, but I am trying to resolve this with the new API available on Lollipop for the users which have this. I successfully request and persist permission […]

What is elevation doing in Android L?

Today I developed my first Android L Apps, and read through the d.android.com/preview tips. They said that android:elevation would show me shadows. But look at this: <TextView android:id=”@+id/tvTest5″ android:layout_width=”50dp” android:layout_height=”50dp” android:layout_below=”@id/btnTest1″ android:layout_toRightOf=”@id/tvTest4″ android:layout_marginLeft=”10dp” android:background=”#000000″ android:elevation=”50dp”/> I don’t see any shadow in my Emulator. Am I doing something wrong or is the Emulator buggy? I’m using […]

Android API21: VoiceInteractionService onReady() not called

I have a problem with the new Android API21, specifically the VoiceInteractorService. I would like to use the new Hotword detection in API21. If i press a button, a hotword detection for the word ‘google’ should start. When I have an Activity (MainActivity) and I want to call the createAlwaysOnHotwordDetector(String keyphrase, Locale locale, AlwaysOnHotwordDetector.Callback callback) […]

What is the android api for getting the list of connected audio devices?

I used the below added code to get the connected audio devices for android device. Used AudioManager api method getDevices() and got the result with connected devices like earphones, speaker, headphones. But this getDevices() method is available since android api level 23 (Marshmallow) only. But my application should support from api level 21 (Lollipop). Please […]

Switch control is not working on Dialog in Android version 5.0

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 xmlns:android=”http://schemas.android.com/apk/res/android”> <item android:state_checked=”false” android:drawable=”@color/red” /> <item android:state_checked=”true” android:drawable=”@color/green” /> </selector> If I add […]

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