I'm using the following code to create a ProgressDialog (inside my Activity):
@Override
protected Dialog onCreateDialog(int id) {
switch (id) {
case DIALOG_LOOKUP:
return new ProgressDialog(this, ProgressDialog.STYLE_SPINNER);
}
return null;
}
@Override
protected void onPrepareDialog(int id, Dialog dialog) {
switch (id) {
case DIALOG_LOOKUP:
dialog.setCancelable(true);
dialog.setTitle(R.string.dialogLookup_title);
((ProgressDialog)dialog).setMessage(getResources().getString(R.string.dialogLookup_message));
dialog.setOnCancelListener(new OnCancelListener() {
@Override
public void onCancel(DialogInterface dialog) {
Toast.makeText(MyActivity.this, "canceled", Toast.LENGTH_SHORT).show();
}
});
break;
}
}
The problem is that it isn't actually setting the title and is putting it in some weird double-box.
It's giving me this:
but I'm expecting something more like this:
Any ideas?