Configuration:
Set the theme to
<application android:allowbackup= "true" android:icon= "@mipmap/ic_launcher" Android:theme = "@android: Style/theme.light.notitlebar" android:label= "@string/app_name" >
Error message:
09-20 10:31:58.185 1392-1392/? e/androidruntime:fatal exception:main Process:networkimageviewer.com.myapplication, PID:1392java.lang.RuntimeException:Unable to start activity componentinfo{networkimageviewer.com.myapplication/networkimageviewer.com.myapplication.welcomeactivity}: Java.lang.IllegalStateException:You need to use a Theme.appcompat Theme (or descendant) with Thisactivity. At Android.app.ActivityThread.performLaunchActivity (Activitythread.java:2192) at Android.app.ActivityThread.handleLaunchActivity (Activitythread.java:2241) at android.app.activitythread.access$(activitythread.java:141) at Android.app.activitythread$h.handlemessage (Activitythread.java:160°) at Android.os.Handler.dispatchMessage (Handler.java:102) at Android.os.Looper.loop (Looper.java:136) at Android.app.ActivityThread.main (Activitythread.java:5049) at java.lang.reflect.Method.invokeNative (Native Method) at Java.lang.reflect.Method.invoke (Met Hod.java:515) at Com.android.internal.os.zygoteinit$methodandargscaller.run (Zygoteinit.java:793) at Com.android.internal.os.ZygoteInit.main (Zygoteinit.java:609) at Dalvik.system.NativeStart.main (Native Method) caused By:java.lang.IllegalStateException:You need To use a Theme.appcompat Theme (or descendant) with Thisactivity. At Android.support.v7.app.AppCompatDelegateImplV7.createSubDecor (Appcompatdelegateimplv7.java:309) at Android.support.v7.app.AppCompatDelegateImplV7.ensureSubDecor (Appcompatdelegateimplv7.java:278) at Android.support.v7.app.AppCompatDelegateImplV7.setContentView (Appcompatdelegateimplv7.java:252) at Android.support.v7.app.AppCompatActivity.setContentView (Appcompatactivity.java:109) at Networkimageviewer.com.myapplication.WelcomeActivity.onCreate (Welcomeactivity.java:22) at Android.app.Activity.performCreate (Activity.java:5249) at Android.app.Instrumentation.callActivityOnCreate (Instrumentation.java:1087) at Android.app.ActivityThread.performLaunchActivity (Activitythread.java:2156) at Android.app.ActivityThread.handleLaunchActivity (Activitythread.java:2241) at android.app.activitythread.access$(activitythread.java:141) at Android.app.activitythread$h.handlemessage (Activitythread.java:160°) at Android.os.Handler.dispatchMessage (Handler.java:102) at Android.os.Looper.loop (Looper.java:136) at Android.app.ActivityThread.main (Activitythread.java:5049) at java.lang.reflect.Method.invokeNative (Native Method) at Java.lang.reflect.Method.invoke (Met Hod.java:515) at Com.android.internal.os.zygoteinit$methodandargscaller.run (Zygoteinit.java:793) at Com.android.internal.os.ZygoteInit.main (Zygoteinit.java:40{) at Dalvik.system.NativeStart.main (Native Method)
Workaround:
to simply add ActionBar Compat your activity or application should use @style/theme.appcompat Theme in ANDROIDMANIFEST.XM L like this:
< Application Android:allowbackup = "true" android:icon= "@mipmap/ic_launcher" android:theme= "@style/ Theme.AppCompat.Light.NoActionBar" android:label=" @string/app_name " >
Http://stackoverflow.com/questions/18063395/actionbarcompat-java-lang-illegalstateexception-you-need-to-use-a-theme-appcom
Java.lang.IllegalStateException:You need to use a theme.appcompat Theme