java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/os/BuildCompat

You are getting NoClassDefFoundError & ClassNotFoundException NoClassDefFoundError in Java comes when Java Virtual Machine is not able to find a particular class at runtime which was available at compile time. FYI You are using Eclipse. Android Studio is a far simpler way to develop for Android if you manage to get the hang of it. … Read more

How can I modify ripple color when using ?attr/selectableItemBackground as background?

Finally I find the solution: instead of using android:colorControlHighlight directly in theme SelectableItemBackground, I should write another style: <style name=”SelectableItemTheme”> <item name=”colorControlHighlight”>@color/ripple_color</item> </style> Then: <style name=”SelectableItemBackground”> <item name=”android:theme”>@style/SelectableItemTheme</item> <item name=”android:background”>?attr/selectableItemBackground</item> </style> Finally add style=”@style/SelectableItemBackground” to View in layout.xml. UPDATED ON 2016/8/26 After N’s release, I found that sometimes we cannot use this method to set … Read more

Set ActionBar Tabs at bottom in ActionBarActivity

You can create your own TabView Bar at any place of screen, for example at bottom work perfectly for swiching fragments simple customize view in tags_icon.xml It is bottom TabView Main activity Class import android.app.Activity; import android.app.Fragment; import android.app.FragmentManager; import android.app.FragmentTransaction; import android.content.Intent; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.Window; import android.widget.ImageView; import android.widget.TabHost; … Read more

CardView Corner Radius

Unless you try to extend the Android CardView class, you cannot customize that attribute from XML. Nonetheless, there is a way of obtaining that effect. Place a CardView inside another CardView and apply a transparent background to your outer CardView and remove its corner radius (“cornerRadios = 0dp”). Your inner CardView will have a cornerRadius … Read more