How to make dialog to look like ICS theme
- by Naruto
from service i'm creating a dialog via a dummy activity. Here i'm able to see black background, overall the theme of dialog looks like Android V 2.2. My application minimum API level is 8, if i use holo theme it says i need min api level as 14.
Here is the code i used to create dialog. How to get ICS theme dialog.
public class PreviewDialog extends Activity{
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
// Show the popup dialog
showDialog(0);
}
@Override
protected Dialog onCreateDialog(int id)
{
super.onCreateDialog(id);
// Build the dialog
AlertDialog.Builder alert = new AlertDialog.Builder(this);
alert.setTitle("ALARM REMINDER");
alert.setMessage("Its time for the alarm ");
alert.setCancelable(false);
alert.setPositiveButton("Dismiss", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
GoogleTaskPreviewDialog.this.finish();
}
});
// Create and return the dialog
AlertDialog dlg = alert.create();
return dlg;
}
}
MY manifest file entry
<activity android:name="PreviewDialog" android:theme="@android:style/Theme.Translucent.NoTitleBar"></activity>