ActionBarSherlock icon indicating copy to clipboard operation
ActionBarSherlock copied to clipboard

ABS causes an IllegalStateException on some devices

Open Don-Doudou opened this issue 10 years ago • 7 comments

In some devices that run Android 2.1+ i have this exception:

java.lang.RuntimeException: Unable to start activity java.lang.IllegalStateException: You must use Theme.Sherlock, Theme.Sherlock.Light, Theme.Sherlock.Light.DarkActionBar, or a derivative. at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1816) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1837) at android.app.ActivityThread.access$1500(ActivityThread.java:132) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1033) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:143) at android.app.ActivityThread.main(ActivityThread.java:4196) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:507) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) at dalvik.system.NativeStart.main(Native Method) Caused by: java.lang.IllegalStateException: You must use Theme.Sherlock, Theme.Sherlock.Light, Theme.Sherlock.Light.DarkActionBar, or a derivative. at com.actionbarsherlock.internal.ActionBarSherlockCompat.generateLayout(ActionBarSherlockCompat.java:976) at com.actionbarsherlock.internal.ActionBarSherlockCompat.installDecor(ActionBarSherlockCompat.java:902) at com.actionbarsherlock.internal.ActionBarSherlockCompat.setContentView(ActionBarSherlockCompat.java:836) at com.actionbarsherlock.app.SherlockActivity.setContentView(SherlockActivity.java:229) at com.don.app.constitutionduniger.MainActivity.onCreate(MainActivity.java:31) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1093) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1780) ... 11 more

Don-Doudou avatar Oct 10 '13 08:10 Don-Doudou

Well, you did read the error message, right? :) The parent style seems to be wrong (maybe in one of the configurations?)

hameno avatar Oct 23 '13 05:10 hameno

It always crash when I open the music balance settings page.

2013/10/23 Philip Schiffer [email protected]

Well, you did read the error message, right? :) The parent style seems to be wrong (maybe in one of the configurations?)

— Reply to this email directly or view it on GitHubhttps://github.com/JakeWharton/ActionBarSherlock/issues/1053#issuecomment-26881960 .

Alex.Liu

alexliubj avatar Oct 23 '13 14:10 alexliubj

When you use actionbarsherlock, in your AndroidManifest.xml you should be specify theme which is inherit from sherlock theme. ex:

thuannv avatar Nov 04 '13 03:11 thuannv

Reference to #966 ?

voydz avatar Nov 06 '13 07:11 voydz

Im using "Theme.Sherlock" style, and I have this exact error in my Developer Console. This is my Manifest:

<application
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/Theme.Sherlock" >

antoni-alvarez avatar Dec 16 '13 01:12 antoni-alvarez

You should specify theme inherits from Theme.Sherlock in your activity instead of your application, as my AndroidManifest.xml below:

    <activity
        android:name="com.vng.labansecurity.MainActivity"
        android:configChanges="screenSize"
        android:label="@string/app_name"
        android:launchMode="singleTask"
        android:theme="@style/Theme.Sherlock"
        android:uiOptions="splitActionBarWhenNarrow" >
        <meta-data
            android:name="android.support.UI_OPTIONS"
            android:value="splitActionBarWhenNarrow" />

        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

thuannv avatar Dec 16 '13 02:12 thuannv

2013/12/16 Thuan Nguyen [email protected]

You should specify theme inherits from Theme.Sherlock in your activity instead of your application, as my AndroidManifest.xml below:

<activity
    android:name="com.vng.labansecurity.MainActivity"
    android:configChanges="screenSize"
    android:label="@string/app_name"
    android:launchMode="singleTask"
    android:theme="@style/Theme.Sherlock"
    android:uiOptions="splitActionBarWhenNarrow" >
    <meta-data
        android:name="android.support.UI_OPTIONS"
        android:value="splitActionBarWhenNarrow" />

    <intent-filter>
        <action android:name="android.intent.action.MAIN" />

        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
</activity>

¡ª Reply to this email directly or view it on GitHubhttps://github.com/JakeWharton/ActionBarSherlock/issues/1053#issuecomment-30628756 .

Oh£¡£¡I Know......thank you for your help£¡£¡

sogrEEN avatar Dec 16 '13 13:12 sogrEEN