Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
This exception is thrown when you are using appcompat
library for ActionBar
and not setting a compatible theme in your manifest file. The compatible themes can be for e.g
android:theme="@style/Theme.AppCompat.Light"
If you are using appcompat
library to support ActionBar
from API 7 or more, you need to keep track of the following info,
1.Always use the latest appcompat
library.
2.Don't forget to add compatible theme like below as per your need. e.g:
android:theme="@style/Theme.AppCompat.Light"
android:theme="@style/Theme.AppCompat.Light.DarkActionBar"
3.Don't use requestWindowFeature(Window.FEATURE_NO_TITLE);
in the Java file i.e don't hide the TitleBar
. Because ActionBar
is the replacement of it.