6

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.

Paresh Mayani
  • 127,700
  • 71
  • 241
  • 295
user506591
  • 172
  • 2
  • 6
  • 2
    `Theme.Dialog` creates a floating transparent widget where you can see underlying activities. Are you sure that the titlebar does not belong to an underlying activity – Peter Knego Nov 13 '10 at 09:08

3 Answers3

14

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>
Peter Knego
  • 79,991
  • 11
  • 123
  • 154
  • this is the CORRECT and greatest answer!!! I wish the OP would accept this answer. saved me so much time. thanks! – kharles Jun 08 '11 at 02:51
3

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

requestWindowFeature(Window.FEATURE_NO_TITLE);
aptwebapps
  • 1,866
  • 1
  • 13
  • 17
  • 2
    yeah but you need to do no.theme in the activity tag in the manifest otherwise you still will have a title flash at application startup – Fred Grott Nov 13 '10 at 20:40
0

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

Krunal
  • 77,632
  • 48
  • 245
  • 261