Very simple.
I have the following code:
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme">
Now when I replace
"@style/AppTheme"
with
"@android:style/Theme.NoTitleBar.Fullscreen"
the application no longer works.
I have asked the question already but had less information, so this has updated details.
There is nothing wrong with the mobile device I am running on, as the logcat works fine generally.
In this case where I want to change the theme the app opens and closes after a fraction of a second.
Here are the logcat details I get. I'm not sure how if I have copied too much but here is everything:
01-21 00:00:45.860 31830-31830/com.example.dennis.activeapp D/dalvikvm﹕ Zygote::ForkAndSpecialize : 0
01-21 00:00:45.869 31830-31830/com.example.dennis.activeapp D/dalvikvm﹕ zygote get new systemTid : 31830
01-21 00:00:45.869 31830-31830/com.example.dennis.activeapp D/dalvikvm﹕ Late-enabling CheckJNI
01-21 00:00:45.871 31830-31835/com.example.dennis.activeapp D/dalvikvm﹕ threadid=2: interp stack at 0x5bb44000
01-21 00:00:45.872 31830-31836/com.example.dennis.activeapp D/dalvikvm﹕ threadid=3: interp stack at 0x5bc86000
01-21 00:00:45.873 31830-31830/com.example.dennis.activeapp D/jdwp﹕ prepping for JDWP over ADB
01-21 00:00:45.873 31830-31836/com.example.dennis.activeapp D/dalvikvm﹕ Elevating priority from 0 to -8
01-21 00:00:45.873 31830-31837/com.example.dennis.activeapp D/dalvikvm﹕ threadid=4: interp stack at 0x5ef76000
01-21 00:00:45.874 31830-31837/com.example.dennis.activeapp D/jdwp﹕ JDWP: thread running
01-21 00:00:45.876 31830-31837/com.example.dennis.activeapp D/jdwp﹕ trying to receive file descriptor from ADB
01-21 00:00:45.877 31830-31838/com.example.dennis.activeapp D/dalvikvm﹕ threadid=5: interp stack at 0x5f094000
01-21 00:00:45.877 31830-31830/com.example.dennis.activeapp D/dalvikvm﹕ zygote get thread init done
01-21 00:00:45.878 31830-31830/com.example.dennis.activeapp D/dalvikvm﹕ create interp thread : stack size=128KB
01-21 00:00:45.878 31830-31830/com.example.dennis.activeapp D/dalvikvm﹕ create new thread
01-21 00:00:45.880 31830-31830/com.example.dennis.activeapp D/dalvikvm﹕ new thread created
01-21 00:00:45.880 31830-31830/com.example.dennis.activeapp D/dalvikvm﹕ update thread list
01-21 00:00:45.884 31830-31839/com.example.dennis.activeapp D/dalvikvm﹕ threadid=6: interp stack at 0x5f0b4000
01-21 00:00:45.884 31830-31839/com.example.dennis.activeapp D/dalvikvm﹕ threadid=6: created from interp
01-21 00:00:45.884 31830-31830/com.example.dennis.activeapp D/dalvikvm﹕ start new thread
01-21 00:00:45.885 31830-31830/com.example.dennis.activeapp D/dalvikvm﹕ create interp thread : stack size=128KB
01-21 00:00:45.885 31830-31830/com.example.dennis.activeapp D/dalvikvm﹕ create new thread
01-21 00:00:45.885 31830-31830/com.example.dennis.activeapp D/dalvikvm﹕ new thread created
01-21 00:00:45.885 31830-31830/com.example.dennis.activeapp D/dalvikvm﹕ update thread list
01-21 00:00:45.885 31830-31839/com.example.dennis.activeapp D/dalvikvm﹕ threadid=6: notify debugger
01-21 00:00:45.885 31830-31839/com.example.dennis.activeapp D/dalvikvm﹕ threadid=6 (ReferenceQueueDaemon): calling run()
01-21 00:00:45.886 31830-31840/com.example.dennis.activeapp D/dalvikvm﹕ threadid=7: interp stack at 0x5f1d2000
01-21 00:00:45.886 31830-31840/com.example.dennis.activeapp D/dalvikvm﹕ threadid=7: created from interp
01-21 00:00:45.886 31830-31830/com.example.dennis.activeapp D/dalvikvm﹕ start new thread
01-21 00:00:45.886 31830-31830/com.example.dennis.activeapp D/dalvikvm﹕ create interp thread : stack size=128KB
01-21 00:00:45.886 31830-31830/com.example.dennis.activeapp D/dalvikvm﹕ create new thread
01-21 00:00:45.887 31830-31830/com.example.dennis.activeapp D/dalvikvm﹕ new thread created
01-21 00:00:45.887 31830-31830/com.example.dennis.activeapp D/dalvikvm﹕ update thread list
01-21 00:00:45.887 31830-31840/com.example.dennis.activeapp D/dalvikvm﹕ threadid=7: notify debugger
01-21 00:00:45.887 31830-31840/com.example.dennis.activeapp D/dalvikvm﹕ threadid=7 (FinalizerDaemon): calling run()
01-21 00:00:45.887 31830-31841/com.example.dennis.activeapp D/dalvikvm﹕ threadid=8: interp stack at 0x5f2f0000
01-21 00:00:45.887 31830-31841/com.example.dennis.activeapp D/dalvikvm﹕ threadid=8: created from interp
01-21 00:00:45.887 31830-31830/com.example.dennis.activeapp D/dalvikvm﹕ start new thread
01-21 00:00:45.891 31830-31841/com.example.dennis.activeapp D/dalvikvm﹕ threadid=8: notify debugger
01-21 00:00:45.891 31830-31841/com.example.dennis.activeapp D/dalvikvm﹕ threadid=8 (FinalizerWatchdogDaemon): calling run()
01-21 00:00:45.892 31830-31837/com.example.dennis.activeapp D/jdwp﹕ received file descriptor 38 from ADB
01-21 00:00:45.914 31830-31842/com.example.dennis.activeapp D/dalvikvm﹕ threadid=9: interp stack at 0x5f70a000
01-21 00:00:45.921 31830-31843/com.example.dennis.activeapp D/dalvikvm﹕ threadid=10: interp stack at 0x5f828000
01-21 00:00:45.960 31830-31830/com.example.dennis.activeapp V/Provider/Settings﹕ invalidate [system]: current 33 != cached 0
01-21 00:00:45.962 31830-31830/com.example.dennis.activeapp D/ActivityThread﹕ hoder:android.app.IActivityManager$ContentProviderHolder@420b2de0,provider,holder.Provider:android.content.ContentProviderProxy@420b3558
01-21 00:00:45.963 31830-31830/com.example.dennis.activeapp V/Provider/Settings﹕ from db cache, name = anr_debugging_mechanism , value = 1
01-21 00:00:45.973 31830-31830/com.example.dennis.activeapp D/asset﹕ AssetManager-->addDefaultAssets CIP path not exsit!
01-21 00:00:45.983 31830-31830/com.example.dennis.activeapp D/Proxy﹕ setHttpRequestCheckHandler
01-21 00:00:45.988 31830-31830/com.example.dennis.activeapp D/dalvikvm﹕ open_cached_dex_file : /data/app/com.example.dennis.activeapp-1.apk /data/dalvik-cache/data@app@com.example.dennis.activeapp-1.apk@classes.dex
01-21 00:00:45.990 31830-31830/com.example.dennis.activeapp D/ActivityThread﹕ BIND_APPLICATION handled : 0 / AppBindData{appInfo=ApplicationInfo{420b05a0 com.example.dennis.activeapp}}
01-21 00:00:46.007 31830-31830/com.example.dennis.activeapp D/AndroidRuntime﹕ Shutting down VM
01-21 00:00:46.007 31830-31830/com.example.dennis.activeapp W/dalvikvm﹕ threadid=1: thread exiting with uncaught exception (group=0x41a6ec98)
01-21 00:00:46.007 31830-31830/com.example.dennis.activeapp W/dalvikvm﹕ threadid=1: uncaught exception occurred
01-21 00:00:46.007 31830-31830/com.example.dennis.activeapp W/System.err﹕ java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.dennis.activeapp/com.example.dennis.activeapp.MainActivity}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
01-21 00:00:46.008 31830-31830/com.example.dennis.activeapp W/System.err﹕ at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2338)
01-21 00:00:46.008 31830-31830/com.example.dennis.activeapp W/System.err﹕ at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2390)
01-21 00:00:46.008 31830-31830/com.example.dennis.activeapp W/System.err﹕ at android.app.ActivityThread.access$800(ActivityThread.java:151)
01-21 00:00:46.008 31830-31830/com.example.dennis.activeapp W/System.err﹕ at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1321)
01-21 00:00:46.008 31830-31830/com.example.dennis.activeapp W/System.err﹕ at android.os.Handler.dispatchMessage(Handler.java:110)
01-21 00:00:46.008 31830-31830/com.example.dennis.activeapp W/System.err﹕ at android.os.Looper.loop(Looper.java:193)
01-21 00:00:46.008 31830-31830/com.example.dennis.activeapp W/System.err﹕ at android.app.ActivityThread.main(ActivityThread.java:5292)
01-21 00:00:46.008 31830-31830/com.example.dennis.activeapp W/System.err﹕ at java.lang.reflect.Method.invokeNative(Native Method)
01-21 00:00:46.008 31830-31830/com.example.dennis.activeapp W/System.err﹕ at java.lang.reflect.Method.invoke(Method.java:515)
01-21 00:00:46.008 31830-31830/com.example.dennis.activeapp W/System.err﹕ at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:828)
01-21 00:00:46.008 31830-31830/com.example.dennis.activeapp W/System.err﹕ at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:644)
01-21 00:00:46.008 31830-31830/com.example.dennis.activeapp W/System.err﹕ at dalvik.system.NativeStart.main(Native Method)
01-21 00:00:46.009 31830-31830/com.example.dennis.activeapp W/System.err﹕ Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
01-21 00:00:46.009 31830-31830/com.example.dennis.activeapp W/System.err﹕ at android.support.v7.app.ActionBarActivityDelegate.onCreate(ActionBarActivityDelegate.java:151)
01-21 00:00:46.010 31830-31830/com.example.dennis.activeapp W/System.err﹕ at android.support.v7.app.ActionBarActivityDelegateBase.onCreate(ActionBarActivityDelegateBase.java:138)
01-21 00:00:46.010 31830-31830/com.example.dennis.activeapp W/System.err﹕ at android.support.v7.app.ActionBarActivity.onCreate(ActionBarActivity.java:123)
01-21 00:00:46.010 31830-31830/com.example.dennis.activeapp W/System.err﹕ at com.example.dennis.activeapp.MainActivity.onCreate(MainActivity.java:19)
01-21 00:00:46.011 31830-31830/com.example.dennis.activeapp W/System.err﹕ at android.app.Activity.performCreate(Activity.java:5264)
01-21 00:00:46.012 31830-31830/com.example.dennis.activeapp W/System.err﹕ at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1088)
01-21 00:00:46.012 31830-31830/com.example.dennis.activeapp W/System.err﹕ at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2302)
01-21 00:00:46.012 31830-31830/com.example.dennis.activeapp W/System.err﹕ ... 11 more
01-21 00:00:46.012 31830-31830/com.example.dennis.activeapp W/dalvikvm﹕ threadid=1: calling UncaughtExceptionHandler
01-21 00:00:46.013 31830-31830/com.example.dennis.activeapp E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: com.example.dennis.activeapp, PID: 31830
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.dennis.activeapp/com.example.dennis.activeapp.MainActivity}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2338)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2390)
at android.app.ActivityThread.access$800(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1321)
at android.os.Handler.dispatchMessage(Handler.java:110)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:5292)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:828)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:644)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
at android.support.v7.app.ActionBarActivityDelegate.onCreate(ActionBarActivityDelegate.java:151)
at android.support.v7.app.ActionBarActivityDelegateBase.onCreate(ActionBarActivityDelegateBase.java:138)
at android.support.v7.app.ActionBarActivity.onCreate(ActionBarActivity.java:123)
at com.example.dennis.activeapp.MainActivity.onCreate(MainActivity.java:19)
at android.app.Activity.performCreate(Activity.java:5264)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1088)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2302)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2390)
at android.app.ActivityThread.access$800(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1321)
at android.os.Handler.dispatchMessage(Handler.java:110)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:5292)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:828)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:644)
at dalvik.system.NativeStart.main(Native Method)
It is driving me crazy, because it should be such a simple fix and I have been trying to research similar issues for hours with no luck whatsoever.
It would be great if someone could provide me with some sort of answer or even an understanding of why this is not working.
No comments:
Post a Comment