gpt4 book ai didi

android - 当尝试删除我的应用程序的标题栏时,我的应用程序崩溃了

转载 作者:行者123 更新时间:2023-12-02 02:46:18 24 4
gpt4 key购买 nike

    <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="uk.co.willmudgelive.ketimer">

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@android:style/Theme.Black.NoTitleBar">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

</manifest>

我指的是android:theme,我检查了多个网站试图找出如何做到这一点,看起来这就是我需要做的,但它不起作用。如有任何帮助,我们将不胜感激。

根据请求,记录:

D/AndroidRuntime: Shutting down VME/AndroidRuntime: FATAL EXCEPTION: main                  Process: uk.co.willmudgelive.ketimer, PID: 21308                  java.lang.RuntimeException: Unable to start activity ComponentInfo{uk.co.willmudgelive.ketimer/uk.co.willmudgelive.ketimer.MainActivity}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.                      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3253)                      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3349)                      at android.app.ActivityThread.access$1100(ActivityThread.java:221)                      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)                      at android.os.Handler.dispatchMessage(Handler.java:102)                      at android.os.Looper.loop(Looper.java:158)                      at android.app.ActivityThread.main(ActivityThread.java:7224)                      at java.lang.reflect.Method.invoke(Native Method)                      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)                      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)                   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:347)                      at android.support.v7.app.AppCompatDelegateImplV9.ensureSubDecor(AppCompatDelegateImplV9.java:316)                      at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:281)                      at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)                      at uk.co.willmudgelive.ketimer.MainActivity.onCreate(MainActivity.java:26)                      at android.app.Activity.performCreate(Activity.java:6876)                      at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1135)                      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3206)                      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3349)                       at android.app.ActivityThread.access$1100(ActivityThread.java:221)                       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)                       at android.os.Handler.dispatchMessage(Handler.java:102)                       at android.os.Looper.loop(Looper.java:158)                       at android.app.ActivityThread.main(ActivityThread.java:7224)                       at java.lang.reflect.Method.invoke(Native Method)                       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)                       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120) I/Process: Sending signal. PID: 21308 SIG: 9Disconnected from the target VM, address: 'localhost:8602', transport: 'socket'

最佳答案

如果您不想同时显示标题和操作栏,那么您可以编写在你的 onCreate() 方法中getSupportActionBar().hide()

关于android - 当尝试删除我的应用程序的标题栏时,我的应用程序崩溃了,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40204675/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com