0

In my application i am using an activity as a dialog.Everything works fine but there is one small problem.Whenever the dialog is shown,the title bar is visible.I had done requestWindowFeature(Window.No.Title) but still the title bar is comming. enter image description here

xml

<style name="CustomDialog" parent="Theme.AppCompat.Light.Dialog">
        <item name="android:windowNoTitle">true</item>
    </style>
androGuy
  • 855
  • 2
  • 8
  • 11

2 Answers2

1

you are using wrong theme

use this

android:Theme.DeviceDefault.Dialog.NoActionBar

also you can hide action bar programmatic .

for that you have to use this in your onCreate mathod

protected void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);
        ActionBar actionBar = getActionBar();
        actionBar.hide();
}
sourabh devpura
  • 605
  • 8
  • 25
0

How about this ?

dialog.requestWindowFeature(Window.FEATURE_NO_TITLE); //before     
dialog.setContentView(R.layout.logindialog);

add this before you show the dialog

this answer originally form here

Community
  • 1
  • 1
Agi Maulana
  • 497
  • 1
  • 6
  • 16