Tag: android-support-library

Attempt to invoke virtual method 'android.os.Handler android.support.v4.app.FragmentHostCallback.getHandler()' on a null object reference

My Application consist of 4 fragment as tabs being loaded inside a parent Fragment using FragmentPagerAdapter. The problem is when I run the app and press back and re-open the app I receive this error log: FATAL EXCEPTION: main java.lang.NullPointerException: Attempt to invoke virtual method ‘android.os.Handler android.support.v4.app.FragmentHostCallback.getHandler()’ on a null object reference at android.support.v4.app.FragmentManagerImpl.ensureExecReady(FragmentManager.java:1949) at […]

Borderless Button on Pre-Lollipop with Support Library

I am making borderless flat button using support library (23.0.1). It works normal on Lollipop. However on pre-Lollipop when I press button Its color changes to colorButtonNormal color like it’s a normal button. I don’t think so it’s a normal behaviour and focused color should be grey like on Lollipop. Here’s the screenshot from Lollipop […]

What is layout_collapseParallaxMultiplier used in CollapsingToolbarLayout?

What is layout_collapseParallaxMultiplier used in CollapsingToolbarLayout ? I have seen the android developer doc, but I didn’t understand. please explain this parameter & it’s effect when it used with layout_collapseMode with example. Below is a simple example of xml. <android.support.design.widget.CollapsingToolbarLayout … > <ImageView android:layout_width=”match_parent” android:layout_height=”match_parent” android:fitsSystemWindows=”true” android:src=”@drawable/random_pattern” android:scaleType=”fitXY” app:layout_collapseMode=”parallax” app:layout_collapseParallaxMultiplier=”0.75″/> </android.support.design.widget.CollapsingToolbarLayout>

RequiresApi vs TargetApi android annotations

Whats the difference between RequiresApi and TargetApi? Sample in kotlin: @RequiresApi(api = Build.VERSION_CODES.M) @TargetApi(Build.VERSION_CODES.M) class FingerprintHandlerM() : FingerprintManager.AuthenticationCallback() NOTE: FingerprintManager.AuthenticationCallback requires api M NOTE 2: if I dont use TargetApi lint fail with error class requires api level 23…

Unable to execute dex: Multiple dex files define Lbolts/AggregateException

I do know Multiple dex problems have been reported a lot of times before, but i none of the solutions seem to work in my case. Console: Unable to execute dex: Multiple dex files define Lbolts/AggregateException; Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Lbolts/AggregateException; One of the popular solutions […]

How to do swipe to delete cardview in android using support library

Hi I am using support library android.support.v7.widget.CardView to achieve cardview functionality in my android app. I want to achieve swipe to delete functionality in it as well. <android.support.v7.widget.CardView xmlns:card_view=”http://schemas.android.com/apk/res-auto” android:id=”@+id/card_view” android:layout_gravity=”center” android:layout_width=”200dp” android:layout_height=”200dp” card_view:cardCornerRadius=”4dp”> <TextView android:id=”@+id/info_text” android:layout_width=”match_parent” android:layout_height=”match_parent” /> </android.support.v7.widget.CardView> How to achieve swipe to delete functionality in it? Thanks in advance.

Android V7 Support Library Popup Menu

I’m trying to implement a PopupMenu with the Support V7 Library. All compiles fine but when I try to call: PopupMenu popup = new PopupMenu(this, v); popup.getMenu().add(Menu.NONE,MENU_SHARE_A,1,R.string.A); popup.getMenu().add(Menu.NONE,MENU_SHARE_B,2,R.string.B); popup.show(); an error occurs on call: 07-31 17:23:53.365: E/AndroidRuntime(14128): java.lang.RuntimeException: Binary XML file line #17: You must supply a layout_height attribute. Which refers I think to “abc_popup_menu_item_layout.xml” […]

Failed to resolve: com.android.support:cardview-v7:26.0.0 android

i try to add recyclerview to my project and get this error appear and i added it from android studio dependencies

ExpandableListFragment with LoaderManager for Compatibility Package

I want to make my ExpandableListActivity compatible with Honeycomb. I am wondering why there is no ExpandableListFragment for the Compatibility Package. Is there a way to make ExpandableListView work with the normal Fragment class? How do I load the Cursors with the LoaderManager?

Design support library – Which version to use with SDK v21

I have problems to understand the version scheme of the support libraries and when to use which version. Currently I have a project with compileSdkVersion 21, minSdkVersion 21 and targetSdkVersion 21 and want to use the android design support library. When I use com.android.support:design:22.2.0 the project compiles but I get a Gradle warning: “This support […]

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