Reputation:
My question is maybe stupid but I'm a beginner I have create navigation drawer application in Android Studio with two Activity. In First Activity ( MainActivity), this activity Show Title Bar but the second Activity(Parametre) does not show Title Bar. Hier ist my code.
Androidmanifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.pandl.fragment">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".SingleViewActivity"></activity>
<activity android:name=".Playboard"></activity>
<activity
android:name=".Parametre"
android:label="Parametre"></activity>
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
</application>
</manifest>
styles.xml
<resources>
<!-- Base application theme. -->
<style name="AppTheme"
parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item
name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
<style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
<style name="BaseTheme" parent="AppTheme">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
<style name="AppTheme.AppBarOverlay"
parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
<style name="AppTheme.PopupOverlay"
parent="ThemeOverlay.AppCompat.Light" />
</resources>
Upvotes: 0
Views: 3548
Reputation: 21
You should either add
public classname extends AppCompatActivity
to have a title bar or
public classname extends Activity
to remove a title bar or you can also use
requestWindowFeature(Window.FEATURE_NO_TITLE)
Upvotes: 1
Reputation: 21
If you are using
extends AppCompatActivity
change it to
extends Activity
in your Java code.
Upvotes: 0
Reputation: 445
Delete the line android:theme="@style/AppTheme.NoActionBar"
. You might want to look into your Theme editor
to see what your default Activity
looks like
Upvotes: 1
Reputation: 92
Change the style of your Activity by removing this line android:theme="@style/AppTheme.NoActionBar">
Upvotes: 1