Note that there are some explanatory texts on larger screens.

plurals
  1. POProblems with ActionBarSherlock themeing
    text
    copied!<p>In the application I am working with an <code>ActionBar Sherlock</code>. The error I am getting seems to be very strange as I am using the same theme for 2 other activities in the application.</p> <p><strong>Manifest:</strong></p> <pre><code> &lt;activity android:name=".ABC" android:label="@string/app_name" android:theme="@style/transTheme" &gt; &lt;intent-filter &gt; &lt;action android:name="com.example.ABC"/&gt; &lt;category android:name="android.intent.category.DEFAULT"/&gt; &lt;/intent-filter&gt; &lt;/activity&gt; &lt;activity android:name=".XYZ" android:label="@string/app_name" android:theme="@style/transTheme" &gt; &lt;intent-filter &gt; &lt;action android:name="com.example.XYZ"/&gt; &lt;category android:name="android.intent.category.DEFAULT"/&gt; &lt;/intent-filter&gt; &lt;/activity&gt; &lt;activity android:name=".123" android:label="@string/app_name" android:theme="@style/transTheme" &gt; &lt;intent-filter &gt; &lt;action android:name="com.example.123"/&gt; &lt;category android:name="android.intent.category.DEFAULT"/&gt; &lt;/intent-filter&gt; &lt;/activity&gt; </code></pre> <p><strong>Style:</strong></p> <pre><code>&lt;!-- Transparent Layout Themeing --&gt; &lt;style name="transTheme" parent="android:style/Theme.Translucent"&gt; &lt;item name ="android:windowNoTitle"&gt;true&lt;/item&gt; &lt;item name ="android:windowContentOverlay"&gt;@null&lt;/item&gt; &lt;item name ="android:backgroundDimEnabled"&gt;true&lt;/item&gt; &lt;item name ="android:background"&gt;@android:color/transparent&lt;/item&gt; &lt;/style&gt; </code></pre> <p>As in the manifest file, activities ABC and XYZ work without errors. I get my error in activity 123. </p> <p><strong>Error Log:</strong></p> <pre><code>09-08 10:40:08.446: E/AndroidRuntime(23791): FATAL EXCEPTION: main 09-08 10:40:08.446: E/AndroidRuntime(23791): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.vaw.selfhelp/com.vaw.selfhelp.SureSMS}: java.lang.IllegalStateException: You must use Theme.Sherlock, Theme.Sherlock.Light, Theme.Sherlock.Light.DarkActionBar, or a derivative. 09-08 10:40:08.446: E/AndroidRuntime(23791): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1651) 09-08 10:40:08.446: E/AndroidRuntime(23791): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667) 09-08 10:40:08.446: E/AndroidRuntime(23791): at android.app.ActivityThread.access$1500(ActivityThread.java:117) 09-08 10:40:08.446: E/AndroidRuntime(23791): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935) 09-08 10:40:08.446: E/AndroidRuntime(23791): at android.os.Handler.dispatchMessage(Handler.java:99) 09-08 10:40:08.446: E/AndroidRuntime(23791): at android.os.Looper.loop(Looper.java:130) 09-08 10:40:08.446: E/AndroidRuntime(23791): at android.app.ActivityThread.main(ActivityThread.java:3687) 09-08 10:40:08.446: E/AndroidRuntime(23791): at java.lang.reflect.Method.invokeNative(Native Method) 09-08 10:40:08.446: E/AndroidRuntime(23791): at java.lang.reflect.Method.invoke(Method.java:507) 09-08 10:40:08.446: E/AndroidRuntime(23791): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867) 09-08 10:40:08.446: E/AndroidRuntime(23791): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:625) 09-08 10:40:08.446: E/AndroidRuntime(23791): at dalvik.system.NativeStart.main(Native Method) 09-08 10:40:08.446: E/AndroidRuntime(23791): Caused by: java.lang.IllegalStateException: You must use Theme.Sherlock, Theme.Sherlock.Light, Theme.Sherlock.Light.DarkActionBar, or a derivative. 09-08 10:40:08.446: E/AndroidRuntime(23791): at com.actionbarsherlock.internal.ActionBarSherlockCompat.generateLayout(ActionBarSherlockCompat.java:1003) 09-08 10:40:08.446: E/AndroidRuntime(23791): at com.actionbarsherlock.internal.ActionBarSherlockCompat.installDecor(ActionBarSherlockCompat.java:915) 09-08 10:40:08.446: E/AndroidRuntime(23791): at com.actionbarsherlock.internal.ActionBarSherlockCompat.setContentView(ActionBarSherlockCompat.java:849) 09-08 10:40:08.446: E/AndroidRuntime(23791): at com.actionbarsherlock.app.SherlockActivity.setContentView(SherlockActivity.java:229) 09-08 10:40:08.446: E/AndroidRuntime(23791): at com.vaw.selfhelp.SureSMS.onCreate(SureSMS.java:29) 09-08 10:40:08.446: E/AndroidRuntime(23791): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) 09-08 10:40:08.446: E/AndroidRuntime(23791): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1615) 09-08 10:40:08.446: E/AndroidRuntime(23791): ... 11 more </code></pre> <p><strong>SureSMS.java (or 123.java) line 29</strong></p> <pre><code>setContentView(R.layout.123layout); </code></pre> <p>I did try using the </p> <pre><code>setTheme(R.style.transTheme) </code></pre> <p>in the java class which got rid of the error but this didn't the activity its transparency. The application works fine for devices HoneyComb and above. I am only getting this error on devices below Android 3.0. Please help. </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload