这是我想用的主题“android:theme =”@ android:style/Theme.Black.NoTitleBar.Fullscreen“在我的应用程序,但对于一些reasonit不断崩溃我app.Can人指出错误?。我改变了价值观的主题文件夹也没有奏效。 的minSdkVersion 17 targetSdkVersion 21我无法更改默认的Android主题,以此Android Studio显示“无法解析符号”错误
package="crystalball.com.example.android.crystlalball" >
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen" >
android:name=".MainActivity"
android:label="@string/app_name"
android:screenOrientation="portrait">
这是logcat:
08-30 15:10:48.220 1969-1969/crystalball.com.example.android.crystlalball I/art﹕ Not late-enabling -Xcheck:jni (already on)
08-30 15:10:48.368 1969-1969/crystalball.com.example.android.crystlalball D/AndroidRuntime﹕ Shutting down VM
--------- beginning of crash
08-30 15:10:48.368 1969-1969/crystalball.com.example.android.crystlalball E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: crystalball.com.example.android.crystlalball, PID: 1969
java.lang.RuntimeException: Unable to start activity ComponentInfo{crystalball.com.example.android.crystlalball/crystalball.com.example.android.crystlalball.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:152)
at android.support.v7.app.ActionBarActivityDelegateBase.onCreate(ActionBarActivityDelegateBase.java:149)
at android.support.v7.app.ActionBarActivity.onCreate(ActionBarActivity.java:123)
at crystalball.com.example.android.crystlalball.MainActivity.onCreate(MainActivity.java:17)
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)
device not found
+0
什么是您的应用的Android SDK版本? –
+0
什么是错误信息?粘贴堆栈跟踪。 –