Hide the title of an activity and the title of an activity.
1. Remove android: label = "@ string/app_name" directly"
<activity android:name=".SplashActivity" android:label="@string/app_name" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity>
Remove
android:label="@string/app_name"
No title!
2. Add requestWindowFeature (Window. FEATURE_NO_TITLE) to onCreate or the above activity, but add the following line of code without displaying the title.
Protected void onCreate (Bundle savedInstanceState) {super. onCreate (savedInstanceState); // hide the title requestWindowFeature (Window. FEATURE_NO_TITLE); setContentView (R. layout. activity_splash );
}
3. Add android: theme = "@ android: style/Theme. Black. NoTitleBar" to the activity corresponding to the configuration file"
<activity android:name=".SplashActivity" android:label="@string/app_name" android:theme="@android:style/Theme.Black.NoTitleBar" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity>
Note: When the dialog is displayed, a black page is displayed! You can also add an item in AppTheme.
<item name="windowNoTitle">true</item>
It can also be applied.