Ejemplo n.º 1
0
  @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);
  }
Ejemplo n.º 2
0
 public void showDialog(String title, String message) {
   DialogFragment newFragment = AlertDialogFragment.newInstance(title, message);
   newFragment.show(getSupportFragmentManager(), "dialog.alert");
 }
Ejemplo n.º 3
0
 void showDialog() {
   DialogFragment newFragment = AlertDialogFragment.newInstance("alert_dialog", null);
   newFragment.show(getFragmentManager(), "dialog");
 }