You create your menu options:
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.your_menu, menu);
return true;
}
Then you use the following for click events on menu items:
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.button1:
UpdateChecker.checkForDialog(Home.this);
return true;
case R.id.option_two:
//do something else
return true;
...
default:
return super.onOptionsItemSelected(item);
}
}
Then choose the dialog that suits your style from the developers website
e.g a standard alert dialog is:
new AlertDialog.Builder(context)
.setTitle("Your Title here")
.setMessage("Your message here")
.setPositiveButton(android.R.string.yes, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
// Do something
}
})
.setNegativeButton(android.R.string.no, null)
.setIcon(android.R.drawable.your_custom_drawbale)
.show();