android - Error :java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity -
<activity android:name="com.luckyxmobile.timers4meplus.activity.widgetconfigactivity" android:theme="@style/theme.pageindicator.dark"> <intent-filter> <action android:name="android.appwidget.action.appwidget_configure" /> <category android:name="com.jakewharton.android.viewpagerindicator.sample.sample" /> </intent-filter> </activity> <style name="theme.pageindicator.dark" parent="android:theme"> <item name="tpi_tabpadding">12dp</item> <item name="tpi_tabripple">@style/darktabripplestyle</item> <item name="tpi_indicatorheight">3dp</item> <item name="tpi_indicatorcolor">@color/colorprimary</item> <item name="android:textappearance">@style/darktabtextappearance</item> <item name="android:background">@color/coloraccent</item> <item name="tpi_mode">scroll</item> </style>
the above theme , style.when run app,show error. think maybe should "theme.appcompat" not "android:theme",but not sure!
whats logcat throws
error :java.lang.illegalstateexception: need use theme.appcompat theme (or descendant) activity
i guess, need extends appcompatactivity
public class widgetconfigactivity extends appcompatactivity { // ... }
appcompatactivity appcompat-v7 library. principally, offers backport of action bar. since native action bar added in api level 11, not need appcompatactivity that. however, current versions of appcompat-v7 add limited backport of material design aesthetic, in terms of action bar , various widgets.
you can use theme.appcompat
instead of android:theme
.
Comments
Post a Comment