title: AlertDialog not showing when not onCreate
body: <p>I have an Activity that have to show an AlertDialog with a ListView for the user to choose one of the options. When I put the code of the AlertDialog in the onCreate method, it works. But when somewhere else, it doesn't. There are no errors on the console.</p>
  
  <p>Here is where it's called (in the Activity):</p>
  
  <pre><code>@Override
  public void onStateChanged(IntegratorState state) {
      switch (state.getState()) {
      case AWAITING_MENU_OPTION:
          IntegratorHelper.showOptionsMenu(state, SitefMenuActivity.this).show();
          break;
      default:
          Toast.makeText(getApplicationContext(), state.getState().name(),
                  Toast.LENGTH_LONG).show();
      }
  }
  </code></pre>
  
  <p>And here is where I create the Dialog (in another class):</p>
  
  <pre><code>public static AlertDialog showOptionsMenu(IntegratorState state, Context context) {
      AlertDialog.Builder builder = new AlertDialog.Builder(context);
      builder.setTitle(state.getGatewayMessageExtra());
      String[] strings;
      strings = state.getGatewayMessage().split(";");
  
      final List&lt;String&gt; options = Arrays.asList(strings);
  
      builder.setAdapter(new MenuSaleAdapter(context,
              android.R.layout.simple_list_item_1, options),
              new DialogInterface.OnClickListener() {
                  @Override
                  public void onClick(DialogInterface dialog, int which) {
                      if (which == options.size()-1) {
                          // Do a thing
                      } else {
                          // Do other thing
                      }
                  }
              });
      return builder.create();
  }
  
  private static class MenuSaleAdapter extends ArrayAdapter&lt;String&gt; {
  
      public MenuSaleAdapter(Context context, int textViewResourceId,
              List&lt;String&gt; objects) {
          super(context, textViewResourceId, objects);
      }
  
      @Override
      public View getView(int position, View convertView, ViewGroup parent) {
          TextView view = (TextView) super.getView(position, convertView,
                  parent);
          view.setTextColor(Color.BLACK);
          return view;
      }
  }
  </code></pre>
  
  <p>I tried to put all the code in the same Activity, but it still doesn't work. The application doesn't freeze or anything, it just don't show the Dialog. Any ideas? Thanks</p>