Regarding the removal of the activity title bar in Android

I already set the theme of my activity as android: theme = "@android: style / Theme.Dialog" but I also want to delete the activity title bar. so how to use android: theme = "@ android: style /Theme.Black.NoTitleBar.Fullscreen" along with the conversational theme.

+6
android coding-style android-theme android-titlebar
source share
3 answers

Try creating your own style that extends Theme.Dialog :

 <resources> <style name="DialogNoTitle" parent="android:Theme.Dialog"> <item name="android:windowNoTitle">true</item> </style> </resources> 
+14
source share

I believe that you can indicate this in your onCreate () activity:

 requestWindowFeature(Window.FEATURE_NO_TITLE); 
+3
source share

For AppCompat , the following solution worked for me:

Add a new theme style without an action bar to styles.xml and set parent="Theme.AppCompat.NoActionBar" .

 <style name="SplashTheme" parent="Theme.AppCompat.NoActionBar"> <item name="colorPrimary">@color/colorPrimary</item> <item name="colorPrimaryDark">@color/colorPrimary</item> <item name="colorAccent">@color/colorAccent</item> <item name="android:windowBackground">@color/colorPrimary</item> </style> 


Now we implement the same theme style for your screensaver activity in androidManifest.xml

 <activity android:name=".ActivityName" android:theme="@style/SplashTheme"> // apply splash them here <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> 

Here is the result:

enter image description here

0
source share

All Articles