I was trying to take the title_bar and the application does not run!

Asked

Viewed 25 times

0

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.ruimiguel.pap">

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@android:style/Theme.NoTitleBar">

        <activity
            android:name=".MainActivity"
            android:theme="@android:style/Theme.NoTitleBar">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

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

</manifest>

inserir a descrição da imagem aqui

inserir a descrição da imagem aqui

inserir a descrição da imagem aqui

I just put: android:theme="@android:style/Theme.NoTitleBar" & android:theme="@android:style/Theme.NoTitleBar"

  • It would be better to present the code in textual form for better analysis.

  • Do not put here in the comments, click EDIT and add the full xml in the question.

  • That’s it! Either this or the other?

  • When the application does not open, it shows some error in Logcat ? Also please inform.

  • No, it just says the app has stopped working ...

1 answer

0

I believe this occurs because you are using AppComatActivity which is not compatible with android:theme="@android:style/Theme.NoTitleBar" try this:

In style.xml:

<style name="Theme.AppCompat.NoTitle" parent="@style/Theme.AppCompat.Light">
    <item name="windowNoTitle">false</item>
    <item name="windowActionBar">false</item>
    <item name="android:windowFullscreen">true</item>
    <item name="android:windowContentOverlay">@null</item>
</style>

And on your manifest leave it so:

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:roundIcon="@mipmap/ic_launcher_round"
    android:supportsRtl="true">

    <activity
        android:name=".MainActivity"
        android:theme="@style/Theme.AppCompat.NoTitle">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

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

Link that can help.

  • I got it all sorted out! Thank you

Browser other questions tagged

You are not signed in. Login or sign up in order to post.