0

I've got a question. I have no idea why my app cant run on the emulator or on my Note 3 when i change the Theme to Theme.Black.NoTitleBar.Fullscreen. When ever i tried to run it. The emulator shows and error message with Force Close button. I'm stuck, please kindly help! Thank you

These are the errors thrown in my logcat

03-27 07:01:34.127: D/AndroidRuntime(2619): Shutting down VM
03-27 07:01:34.127: W/dalvikvm(2619): threadid=1: thread exiting with uncaught exception (group=0xa4d05b20)
03-27 07:01:34.127: E/AndroidRuntime(2619): FATAL EXCEPTION: main
03-27 07:01:34.127: E/AndroidRuntime(2619): Process: com.example.crystalball, PID: 2619
03-27 07:01:34.127: E/AndroidRuntime(2619): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.crystalball/com.example.crystalball.MainActivity}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
03-27 07:01:34.127: E/AndroidRuntime(2619):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195)
03-27 07:01:34.127: E/AndroidRuntime(2619):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
03-27 07:01:34.127: E/AndroidRuntime(2619):     at android.app.ActivityThread.access$800(ActivityThread.java:135)
03-27 07:01:34.127: E/AndroidRuntime(2619):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
03-27 07:01:34.127: E/AndroidRuntime(2619):     at android.os.Handler.dispatchMessage(Handler.java:102)
03-27 07:01:34.127: E/AndroidRuntime(2619):     at android.os.Looper.loop(Looper.java:136)
03-27 07:01:34.127: E/AndroidRuntime(2619):     at android.app.ActivityThread.main(ActivityThread.java:5017)
03-27 07:01:34.127: E/AndroidRuntime(2619):     at java.lang.reflect.Method.invokeNative(Native Method)
03-27 07:01:34.127: E/AndroidRuntime(2619):     at java.lang.reflect.Method.invoke(Method.java:515)
03-27 07:01:34.127: E/AndroidRuntime(2619):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
03-27 07:01:34.127: E/AndroidRuntime(2619):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
03-27 07:01:34.127: E/AndroidRuntime(2619):     at dalvik.system.NativeStart.main(Native Method)
03-27 07:01:34.127: E/AndroidRuntime(2619): Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
03-27 07:01:34.127: E/AndroidRuntime(2619):     at android.support.v7.app.ActionBarActivityDelegate.onCreate(ActionBarActivityDelegate.java:111)
03-27 07:01:34.127: E/AndroidRuntime(2619):     at android.support.v7.app.ActionBarActivityDelegateICS.onCreate(ActionBarActivityDelegateICS.java:58)
03-27 07:01:34.127: E/AndroidRuntime(2619):     at android.support.v7.app.ActionBarActivity.onCreate(ActionBarActivity.java:98)
03-27 07:01:34.127: E/AndroidRuntime(2619):     at com.example.crystalball.MainActivity.onCreate(MainActivity.java:19)
03-27 07:01:34.127: E/AndroidRuntime(2619):     at android.app.Activity.performCreate(Activity.java:5231)
03-27 07:01:34.127: E/AndroidRuntime(2619):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
03-27 07:01:34.127: E/AndroidRuntime(2619):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
03-27 07:01:34.127: E/AndroidRuntime(2619):     ... 11 more
Devora
  • 357
  • 4
  • 14

1 Answers1

0

The Log says:

You need to use a Theme.AppCompat theme (or descendant) with this activity.
03-27 07:01:34.127: E/AndroidRuntime(2619): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195)

Explanation:

The reason you are having this problem is because the activity you are trying 
to apply the theme to is extending ActionBarActivity which 
requires the AppCompat theme to be applied.

Change the parent of the actual java code to be just plain Activity and 
you should be able to leave the theme on it.

Picked from here.

Hope that helps!

Community
  • 1
  • 1