Error inflating class android.support.design.widget.NavigationView

Actually it is not the matter of the primarycolortext, upgrading or downgrading the dependencies.This problem will likely occur when the version of your appcompat library and design support library doesn’t match. Example of matching condition compile ‘com.android.support:appcompat-v7:23.1.1’ // appcompat library compile ‘com.android.support:design:23.1.1’ //design support library

Cannot resolve symbol AppCompatActivity – Support v7 libraries aren’t recognized?

For me, Even after upgrading to appcompat-v7:22.1.0, in which AppCompatActivty is added, the problem was not resolved for me, Android Studio was giving same problem Cannot resolve symbol ‘AppCompatActivity’ Sometimes clearing the android studio caches help. In android studio I just cleared the caches and restarted with the following option– File->Invalidate Caches/Restart

Android vector drawable app:srcCompat not showing images

Original Answer Use android.support.v7.widget.AppCompatImageView instead of ImageView in your layout, like this: <LinearLayout … xmlns:android=”http://schemas.android.com/apk/res/android” xmlns:app=”http://schemas.android.com/apk/res-auto”> <android.support.v7.widget.AppCompatImageView android:tint=”#d74313″ app:srcCompat=”@drawable/circle_icon” android:layout_width=”30sp” android:layout_height=”30sp” /> <android.support.v7.widget.AppCompatImageView android:layout_centerVertical=”true” android:layout_centerHorizontal=”true” app:srcCompat=”@drawable/lauzaviete” android:layout_width=”25dp” android:layout_height=”25dp” /> </LinearLayout> See the AppCompatImageView docs here and app:srcCompat here. Also, make sure to do the following: Setup your build.gradle android { defaultConfig { vectorDrawables { useSupportLibrary … Read more

java.lang.NoClassDefFoundError: android/graphics/drawable/Icon

Update The issue is fixed in support library 27.0.0. If you update don’t forget to change compileSdkVersion 27 as well. What is happening? Samsung devices with Android 4.4 crash like this when classes extending View define methods which return or take parameters of types that are not on classpath. Starting with support library version 25.4.0 … Read more

Display ActionMode over Toolbar

Since you are using the Toolbar, I also assume you are using the AppCompatActivity and have replaced the built in ActionBar with your custom Toolbar using setSupportActionBar(toolbar); First of all ensure you are importing the correct namespace: import androidx.appcompat.view.ActionMode; // Or import android.support.v7.view.ActionMode; and NOT import android.view.ActionMode; then use _actionMode = startSupportActionMode(this); and NOT _actionMode … Read more

Using android vector Drawables on pre Lollipop crash

LATEST UPDATE – Jun/2019 Support Library has changed a bit since the original answer. Now, even the Android plugin for Gradle is able to automatically generate the PNG at build time. So, below are two new approaches that should work these days. You can find more info here: PNG Generation Gradle can automatically create PNG … Read more

ERROR :rendering problems The following classes could not be found android.support.v7.internal.widget.ActionBarOverlayLayout

Fix res/values/styles.xml like so: <style name=”AppTheme” parent=”Base.Theme.AppCompat.Light.DarkActionBar”/> Detailed explanation as requested: Theme.AppCompat.Light.DarkActionBar is a subclass of the superclass Base anyway. Ctrl+click (Android Studio) on it and you will be taken to the source: <style name=”Theme.AppCompat.Light.DarkActionBar” parent=”Base.Theme.AppCompat.Light.DarkActionBar” /> We didn’t change anything, we just defined it more precisely.

FloatingActionButton with text instead of image

Thanks to all. Here is easy workaround which I found for this question. Works correctly for Android 4+, for Android 5+ is added specific parameter android:elevation to draw TextView over FloatingActionButton. <FrameLayout android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:layout_gravity=”bottom|right”> <android.support.design.widget.FloatingActionButton android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:src=”https://stackoverflow.com/questions/33671196/@android:color/transparent” /> <TextView android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:layout_gravity=”center” android:text=”@android:string/ok” android:elevation=”16dp” android:textColor=”@android:color/white” android:textAppearance=”?android:attr/textAppearanceMedium” /> </FrameLayout>

Android: Bottom Navigation View – change icon of selected item

You can simply create drawable selector in drawable folder and image can be change according to the state of the widget used in view <?xml version=”1.0″ encoding=”utf-8″?> <selector xmlns:android=”http://schemas.android.com/apk/res/android”> <item android:drawable=”@drawable/calender_green” android:state_checked=”true”/> <item android:drawable=”@drawable/calender_black” android:state_checked=”false”/> </selector>