Tag: android-5.0-lollipop

Activity and Fragment Transitions in Lollipop

I’m trying to wrap my head around the new Activity Transition framework in Lollipop. The Activity Transition works pretty straighforward and there are some basic info here, but the Fragment Transition is undocumented and I can’t get it to work. I’ve tried this use case (very common in Android): case 1: ActA+FragA -> ActB+FragB with […]

How to close ACTION_USAGE_ACCESS_SETTINGS intent when user click correct target application?

I am using Intent ACTION_USAGE_ACCESS_SETTINGS in setting (Settings->Security->Apps with usage access) to use UsageStatsManager in the Lollipop version. public static final int MY_PERMISSIONS_REQUEST_PACKAGE_USAGE_STATS = 1; if(!hasPermission()){ startActivityForResult( new Intent(Settings.ACTION_USAGE_ACCESS_SETTINGS), MY_PERMISSIONS_REQUEST_PACKAGE_USAGE_STATS); } First, onCreate() will check the permission for the app. and turn on the Intent if the app has no permission (does not check) @TargetApi(Build.VERSION_CODES.LOLLIPOP) […]

Stylizing material buttons in Android v21

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 margin/gap: I want the layout […]

API21 setButtonTintList on CheckBox

I am trying to use the new Android Lollipop API setButtonTintList() to programmatically apply colors to android CheckBoxes. I have set the following basic ColorStateList in checkbox_color.xml: <?xml version=”1.0″ encoding=”utf-8″?> <selector xmlns:android=”http://schemas.android.com/apk/res/android”> <item android:state_checked=”true” android:color=”@color/red” /> <item android:state_checked=”false” android:color=”@color/green” /> </selector> On a specific Button click in my app I inflate a new layout that […]

Different flavors with GCM

I have two flavors of my app, one debug and one release. The reason why these are different flavors is that I want to allow others to download the debug version to test out new features. So it should be possible to have both apps installed at once. My app uses GCM which has created […]

Native crash at /system/lib/libart.so on lollipop android 5.0.1 samsung

I’ve an app built using cordova on google Play Store. The app works on all devices and models, except on a few Samsung devices running on android 5.0.1 (Note3 and Note4). The app crashes on launch. The crash stack trace is the following: *** *** *** *** *** *** *** *** *** *** *** *** […]

Lollipop EditBox styling

I currently have this one: Is it possible to remove black stroke and have only highlighted? Does it violate any Google guideline about material design

Ripples not showing with selectableItemBackground as foreground on a CardView with a Android 5.0 device

I’m running this on a Nexus 5. Here’s part of the code for my CardView: CardView cardView = new CardView(getActivity()); cardView.setRadius(4); LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, 400); lp.setMargins(32, 16, 32, 16); cardView.setLayoutParams(lp); cardView.setContentPadding(50, 50, 50, 50); … cardView.setForeground(selectedItemDrawable); And here’s how I get the selectedItemDrawable: int[] attrs = new int[] { R.attr.selectableItemBackground }; TypedArray ta […]

MultiDex support in Android application error

I want to use Android L compat libs. after adding the relevant code to gradle, I get the error: Error Code: 2 Output: objc[36290]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.7.0_67.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.7.0_67.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined. UNEXPECTED TOP-LEVEL EXCEPTION: java.lang.IllegalArgumentException: method ID not in [0, 0xffff]: 65536 […]

SDK 5.0 RecyclerView could not be instantiated

I’m testing the new API 21, I try to create a RecyclerView but I’m stuck with a dependency problem. The error look like that my layout : <RelativeLayout xmlns:android=”http://schemas.android.com/apk/res/android” android:layout_width=”match_parent” android:layout_height=”match_parent” android:paddingLeft=”@dimen/activity_horizontal_margin” android:paddingRight=”@dimen/activity_horizontal_margin” android:paddingTop=”@dimen/activity_vertical_margin” android:paddingBottom=”@dimen/activity_vertical_margin”> <!– A RecyclerView with some commonly used attributes –> <android.support.v7.widget.RecyclerView android:id=”@+id/mRecyclerView” android:scrollbars=”vertical” android:layout_width=”match_parent” android:layout_height=”match_parent” /> </RelativeLayout> and my gradle file […]

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