Monday, July 15, 2013

Custom Android Dialog Without Title

I searched a lot for creating android custom dialog without title. At last i found the following. Create custom android dialog without title in the following way.

Step-1: Add a android style in style.xml file :
          <style name="TitleLessDialog" parent="android:style/Theme.Dialog">
    <item name="android:windowNoTitle">true</item>
 </style>

Step-2: While declaring the dialog in your activity file declare as following

.
import android.app.Dialog;

import android.content.Context;
.
.
Context context = this;
Dialog dialog = new Dialog(context,R.style.TitleLessDialog);
.
.
.


The rest of your code is as usual Dialog building code.

Thank you.
bodhisattwa

No comments:

Post a Comment