Type 1:
AlertDialog.Builder builder;
builder = new AlertDialog.Builder(context);
String msgTitle="Success";
String msgBody="Please go to your email to get your password.";
builder.setMessage(msgBody)
.setTitle(msgTitle);
AlertDialog dialog = builder.create();
dialog.show();
dismiss listener:
reference: http://stackoverflow.com/questions/17544819/how-to-know-if-a-dialog-is-dismissed-in-android
public Dialog createDialog() {
Dialog d = new Dialog(this);
d.setOnDismissListener(new OnDismissListener() {
@Override
public void onDismiss(final DialogInterface arg0) {
// do something
}
});
return d;
}
Type 2:
Toast.makeText(getApplicationContext(),"The field of e-mail is empty.", Toast.LENGTH_SHORT).show();
沒有留言:
張貼留言