Steps:
- Use AlertDialog.Builder API to create/build your custome alert dialog.
- Explore the api of AlertDialog.Builder. There are lot of customizations possible. Some listed here
if(validationError){ // Just an example.
new AlertDialog.Builder(MyActivity.this)
.setTitle("Error")
.setMessage("Please enter valid amount")
.setNeutralButton("Close", null)
.show();
}
Refer AlertDialog.Builder API for more customizations.
Output:
The above code will give you an alert dialog like this.
No comments:
Post a Comment