Tag: android-5.0-lollipop

How to get recent tasks on Android “L”?

Background My app allows to sort an apps list by the time they were recently launched . The problem As of Android “L” , the function getRecentTasks will just return the list of apps that the current app has launched, as written in the documentation: If your app uses ActivityManager.getRecentTasks()… With the introduction of the […]

Android Lollipop – changed behavior of SQLite

When testing one of my apps for Android 5.0 compatibility I found that one two of my SQL queries doesn’t don’t work as expected anymore on Lollipop. Both of my problems led to significantly different results on Lollipop compared to older Android versions. Below, I will describe those problems and their solutions more deeply in […]

How to fix IncompatibleClassChangeError during Android Jackson Parsing using annotations in Android Lollipop?

In our android app, we use Jackson Annotations in our models: @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = “templateType”, visible = true, defaultImpl = Default.class) @JsonSubTypes({ @Type(value = Subclass1.class, name = “tType1”) We parse the json response using object mapper where klass is the class of the object file which we wish to parse […]

Android FAB plus sign not present on android drawable

Where can I find the plus sign at the center of a Floating Action Button? Is it made by Android or do I need to do it by my self?

How can I place a ProgressBar at the right of the Toolbar?

With the new Lollipop API, we have to use a Toolbar if we want to personalize the action bar aspect. Adding a ProgressBar to the Toolbar is as simple as adding it to the Toolbar ViewGroup, as Chris Banes said. <android.support.v7.widget.Toolbar xmlns:android=”http://schemas.android.com/apk/res/android” xmlns:app=”http://schemas.android.com/apk/res-auto” android:id=”@+id/toolbar” android:layout_width=”match_parent” android:layout_height=”wrap_content” android:background=”@color/material_green_500″ android:minHeight=”?attr/actionBarSize” app:popupTheme=”@style/ThemeOverlay.AppCompat.Light” app:theme=”@style/ThemeOverlay.AppCompat.Dark.ActionBar”> <!– Color is Brown 500 […]

setSupportProgressBarIndeterminateVisibility raising java.lang.NullPointerException when used with Android 5.0 SDK (API 21)

My activity class extends android.support.v7.app.ActionBarActivity. I am requesting window feature and calling setSupportProgressBarIndeterminateVisibility() in the onCreate() method as follows: protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); supportRequestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS); setContentView(R.layout.activity_main); setSupportProgressBarIndeterminateVisibility(true); } I cannot grasp what’s wrong with my code and why I am getting java.lang.NullPointerException raised by the setSupportProgressBarIndeterminateVisibility(). My gradle dependencies contains: compile ‘com.android.support:appcompat-v7:21.0.0’ Does anybody […]

Android 5.0 Lollipop and 4.4 KitKat ignores my WiFi network, enableNetwork() is useless

My app connect directly to a hardware device that act as an access point (with no access to internet). I can’t connect because Android 5.0 automaticcaly switch to a valid internet connection, so if I have data connection (3G, 4G, …) or a pre-configured network I can’t connect to my device because it ignores the […]

Android 5.0 JobScheduler API on earlier versions?

I’m building an Android application, which makes use of a manifest broadcast receiver to know when the device is plugged in. I think Android 5.0 JobScheduler API would be a much better way of doing this, but I have one question: is it possible to use this API or a similar one on earlier versions […]

Error inflating class RecyclerView

So my code simply makes a list of CardViews using RecyclerView. Upon running my code i kept getting a weird error claiming there was an error in my xml. After tinkering for a while i found out that in my layout file if i change <RecyclerView> to <android.support.v7.widget.RecyclerView> everything would work just fine. Why is […]

Elevation on Android Lollipop not working

I am trying to make use of the elevation property in the latest Android Lollipop preview release. I set the targetSdk to 21 and the theme to Material. Next i added a background shape to a TextView and set the elevation to 8dp but the TextView is not showing any signs of a shadow. That […]

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