Question

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

Was it helpful?

Solution

Try creating a custom style that extends Theme.Dialog:

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

OTHER TIPS

I believe you can specify this in your activity's onCreate():

requestWindowFeature(Window.FEATURE_NO_TITLE);

For AppCompat, following solution worked for me:

Add new theme style with no action bar in your 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 implement the same theme style to your splash screen 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 result:

enter image description here

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top