学校里作业,要求我们创建一个HelloAndroid然后主题改成android:theme="@android:style/Theme.Holo",可是我一改进去运行就stop,别的人都没问题,我们的AndroidManifest.xml也是一样的

解决方案 »

  1.   

    android:theme="@android:style/Theme.Holo"
    Theme.Holo试着换一个名字,不要加特殊符号
      

  2.   

    什么意思,改成Theme.Black还是没用
      

  3.   

    什么意思,改成Theme.Black还是没用
    Clean一下重新编译试试
      

  4.   

    E/AndroidRuntime: FATAL EXCEPTION: main
                      Process: hello.cslg.edu.cn.helloandroid, PID: 5761
                      java.lang.RuntimeException: Unable to start activity ComponentInfo{hello.cslg.edu.cn.helloandroid/hello.cslg.edu.cn.helloandroid.HelloActivity}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
                          at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2913)
                          at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048)
                          at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
                          at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
                          at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
                          at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808)
                          at android.os.Handler.dispatchMessage(Handler.java:106)
                          at android.os.Looper.loop(Looper.java:193)
                          at android.app.ActivityThread.main(ActivityThread.java:6669)
                          at java.lang.reflect.Method.invoke(Native Method)
                          at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
                          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
                       Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
                          at android.support.v7.app.AppCompatDelegateImplV9.createSubDecor(AppCompatDelegateImplV9.java:354)
                          at android.support.v7.app.AppCompatDelegateImplV9.ensureSubDecor(AppCompatDelegateImplV9.java:323)
                          at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:284)
                          at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139)
                          at hello.cslg.edu.cn.helloandroid.HelloActivity.onCreate(HelloActivity.java:11)
                          at android.app.Activity.performCreate(Activity.java:7136)
                          at android.app.Activity.performCreate(Activity.java:7127)
                          at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
                          at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2893)
                          at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048) 
                          at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78) 
                          at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108) 
                          at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68) 
                          at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808) 
                          at android.os.Handler.dispatchMessage(Handler.java:106) 
                          at android.os.Looper.loop(Looper.java:193) 
                          at android.app.ActivityThread.main(ActivityThread.java:6669) 
                          at java.lang.reflect.Method.invoke(Native Method) 
                          at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) 
                          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858) 
    Application terminated.
    这个吗
      

  5.   

    You need to use a Theme.AppCompat theme (or descendant) with this activity.
      

  6.   

    You need to use a Theme.AppCompat theme (or descendant) with this activity. 
    要怎么改这不是告诉你了吗,要学会看崩溃信息啊,还要学会自己百度啊  https://blog.csdn.net/ouyang_peng/article/details/51334761 看人家博客都写得这么清晰了 
      

  7.   

    把你的activity改成继承Activity,不要继承AppCompatActivity