Android開発中に起こったThemeに関するエラー
来源:互联网 发布:软件著作权 模块 编辑:程序博客网 时间:2024/05/27 02:30
Android開発中に起こったThemeに関するエラー
Project作ってFullscreenで何か作ろうかなと思った時に発生したエラーがこちら
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
02-0921:47:43.41131033-31033/?E/AndroidRuntime:FATALEXCEPTION:main
Process:jp.co.fullscreen,PID:31033
java.lang.RuntimeException:UnabletostartactivityComponentInfo{jp.co.fullscreen/jp.co.fullscreen.MainActivity}:java.lang.IllegalStateException:YouneedtouseaTheme.AppCompattheme(ordescendant)withthisactivity.
atandroid.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416)
atandroid.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
atandroid.app.ActivityThread.-wrap11(ActivityThread.java)
atandroid.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
atandroid.os.Handler.dispatchMessage(Handler.java:102)
atandroid.os.Looper.loop(Looper.java:148)
atandroid.app.ActivityThread.main(ActivityThread.java:5417)
atjava.lang.reflect.Method.invoke(NativeMethod)
atcom.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
atcom.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Causedby:java.lang.IllegalStateException:YouneedtouseaTheme.AppCompattheme(ordescendant)withthisactivity.
atandroid.support.v7.app.AppCompatDelegateImplV7.createSubDecor(AppCompatDelegateImplV7.java:310)
atandroid.support.v7.app.AppCompatDelegateImplV7.ensureSubDecor(AppCompatDelegateImplV7.java:279)
atandroid.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:253)
atandroid.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:109)
atjp.co.fullscreen.MainActivity.onCreate(MainActivity.java:11)
atandroid.app.Activity.performCreate(Activity.java:6251)
atandroid.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
atandroid.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
atandroid.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
atandroid.app.ActivityThread.-wrap11(ActivityThread.java)
atandroid.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
atandroid.os.Handler.dispatchMessage(Handler.java:102)
atandroid.os.Looper.loop(Looper.java:148)
atandroid.app.ActivityThread.main(ActivityThread.java:5417)
atjava.lang.reflect.Method.invoke(NativeMethod)
atcom.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
atcom.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)<br>
非常に長いので必要な部分だけ取り出してみてみました
java.lang.RuntimeException: Unable to start activity ComponentInfo{jp.co.fullscreen/jp.co.fullscreen.MainActivity}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
内容としてはAppCompatActivityを継承してるんだからThemeにTheme.AppCompatまたはTheme.AppCompatを含んだThemeを指定しろ
ということでした
なのでMainActivity内のAppCompatActivityをActivityに変えて
0 0
- Android開発中に起こったThemeに関するエラー
- android:theme
- android:theme
- android theme
- Android:theme
- android theme
- Android Theme
- android theme
- android:theme
- android Theme
- android:theme
- Android:theme
- Android Theme
- Android Theme
- android:theme
- android:theme
- Android theme
- Android Theme
- JSTL
- Android-php后台优化之数据库优化(一)表的优化1
- <hadoop>reduce自定义类排序
- 想矫情
- Hololens第三人称视角Spectator View!
- Android開発中に起こったThemeに関するエラー
- 蓝桥杯-算法训练 大小写转换
- [Leetcode] 21. Merge Two Sorted Lists
- 字符串
- 对cuda函数grid中的block的理解(1)
- MySql学习(七) —— 查询性能优化 深入理解MySql如何执行查询
- TCP链接的状态
- cf#302 C. Writing Code dp
- Giraph的一些背景介绍