1. If your activity is inherited from activity, then
A. To write in Style.xml:
<style name= "apptheme" parent= "Theme.AppCompat.Light.DarkActionBar" >
<item name= "Windownotitle" >true</item>
</style>
B. Write in the application tag in Androidmanifest.xml:
Android:theme= "@style/apptheme"
2. If your activity is inherited from Appcompatactivity, then
A. To write in Style.xml:
<style name= "apptheme" parent= "Theme.AppCompat.Light.DarkActionBar" >
<item name= "Windownotitle" >true</item>
<item name= "Windowactionbar" >false</item>
</style>
B. Write in the application tag in Androidmanifest.xml:
Android:theme= "@style/apptheme"
Note: The above two methods will set all the pages to no title bar status.
3. If you do not want to set all the pages have no title bar, but the individual pages no title bar
For example: only mainactivity the corresponding page does not have the title bar, the other is the default state, then
A. To add in the Style.xml:
<style name= "apptwotheme" parent= "Theme.AppCompat.Light.DarkActionBar" >
<item name= "Windownotitle" >true</item>
<item name= "Windowactionbar" >false</item>
</style>
B. In the Activity tab in Androidmanifest.xml, write:
<activity android:name= ". Mainactivity " android:theme=" @style/apptwotheme ">
<intent-filter>
<action android:name= "Android.intent.action.MAIN"/>
<category android:name= "Android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
Android Removal title bar