I have an activity that has the following set as theme:
android:theme="@android:style/Theme.Dialog"
However, there is a title bar in the activity-dialog that appears, that uses up the little available space that I have. How can I remove it?
I have an activity that has the following set as theme:
android:theme="@android:style/Theme.Dialog"
However, there is a title bar in the activity-dialog that appears, that uses up the little available space that I have. How can I remove it?
Try doing
requestWindowFeature(Window.FEATURE_NO_TITLE);
inonCreate
. It'll need to be done immediately after callingsuper.onCreate
and just beforesetContentView
.If you are using
AppCompatActivity
in which you are forced to useTheme.AppCompat.xxx
for everything, you can remove the dialog title or actionbar instyles.xml
using this:Notice the use of
name="windowActionBar"
, instead ofname="android:windowActionBar"
.This one worked for me for appcompat.
for dialogs, you can do it like:
This works for me, may it helps someone too :
style.xml
AndroidManifest.xml
If you are using AppCompatActivity requestWindowFeature(Window.FEATURE_NO_TITLE) is not working.
for this you can create custom theme in values/style.xml as below:
please note that item name:"windowNoTitle" not item name:"android:windowNoTitle"
In menifest.xml apply this custom theme as
or you can use getSupportActionBar().hide() to programmatically hide action bar.