@Override public boolean onOptionsItemSelected(MenuItem item) { // Handle action bar item clicks here. The action bar will // automatically handle clicks on the Home/Up button, so long // as you specify a parent activity in AndroidManifest.xml. int id = item.getItemId(); //noinspection SimplifiableIfStatement if (id == R.id.more_info) { DialogFragment newFragment = AlertDialogFragment.newInstance(); newFragment.show(getFragmentManager(), "dialog"); } return super.onOptionsItemSelected(item); }
public void showDialog(String title, String message) { DialogFragment newFragment = AlertDialogFragment.newInstance(title, message); newFragment.show(getSupportFragmentManager(), "dialog.alert"); }
void showDialog() { DialogFragment newFragment = AlertDialogFragment.newInstance("alert_dialog", null); newFragment.show(getFragmentManager(), "dialog"); }