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

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>

Ionlyput:android:theme="@android:style/Theme.NoTitleBar" & android:theme="@android:style/Theme.NoTitleBar"

    
asked by anonymous 07.03.2018 / 11:53

1 answer

0

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

No 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 in your manifest leave it like this:

<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 .

    
07.03.2018 / 12:49