android应用程序在我的Desive nexus 4 android 5.0上崩溃。您需要在此活动中使用Theme.AppCompat主题(或后代)
当我在我的Desive上运行我的应用程序时,我创建了一个android项目,其中的空白活动是使用fragment和minSdkVersion 10和targetSdkVersion 21创建的,我不知道为什么应用程序崩溃了 当我从ActionBarActivity切换到活动时,应用程序工作,但我希望使用ActionBarActivity创建应用程序 logcat告诉我此错误无法启动活动组件信息{com.rhanem.android.forecast.app/com.rhanem.android.forecast.app.MainActivity}:java.lang.IllegalStateException:活动已被销毁 她用logcat给我留言android应用程序在我的Desive nexus 4 android 5.0上崩溃。您需要在此活动中使用Theme.AppCompat主题(或后代),android,android-fragments,devise,android-actionbar,android-actionbaractivity,Android,Android Fragments,Devise,Android Actionbar,Android Actionbaractivity,当我在我的Desive上运行我的应用程序时,我创建了一个android项目,其中的空白活动是使用fragment和minSdkVersion 10和targetSdkVersion 21创建的,我不知道为什么应用程序崩溃了 当我从ActionBarActivity切换到活动时,应用程序工作,但我希望使用ActionBarActivity创建应用程序 logcat告诉我此错误无法启动活动组件信息{com.rhanem.android.forecast.app/com.rhanem.android.
Process: com.rhanem.android.forecast.app, PID: 3644
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.rhanem.android.forecast.app/com.rhanem.android.forecast.app.MainActivity}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2298)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360)
at android.app.ActivityThread.access$800(ActivityThread.java:144)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5221)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
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.rhanem.android.sunshine.app.MainActivity.onCreate(MainActivity.java:20)
at android.app.Activity.performCreate(Activity.java:5933)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2251)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360)
at android.app.ActivityThread.access$800(ActivityThread.java:144)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5221)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
请帮助清单文件中的my为您的活动指定Theme.AppCompat主题(或其后代)。
android:theme=“theme.AppCompat”
logcat告诉我无法启动活动的错误java.lang.IllegalStateException:activity已被销毁您何时遇到此异常?我需要更多的细节。