title: popup dialog as input
body: <p>Hey, I have a problem with implementing a popup dialog like this one in this example: <a href="http://malsandroid.blogspot.com/2010/04/list-picker-and-fading-popup-notice.html" rel="nofollow">http://malsandroid.blogspot.com/2010/04/list-picker-and-fading-popup-notice.html</a></p>
  
  <p>Its working just fine if I implement the code for a editbox. The problem is, that I want to use a options menu in the app that lets the user control if he wants to use the standard keyboard in android or this popup dialog as input to the editboxes.</p>
  
  <p>If i put this code directly into the main.java class it works fine as I just said ( same as code example above ):</p>
  
  <pre><code>hcp_entry_player_1 = (EditText)findViewById( R.id.hcp_entry_player_1 );
  
  final CharSequence[] items = {"1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"};
  AlertDialog.Builder builder = new AlertDialog.Builder(this);
  builder.setTitle("Pick a hcp");
  builder.setItems(items, new DialogInterface.OnClickListener()
  {
      public void onClick(DialogInterface dialogInterface, int item) 
      {
          hcp_entry_player_1.setText(items[item]);
          Toast.makeText(getApplicationContext(), items[item], Toast.LENGTH_SHORT).show();
  
          return;
      }
  });
  
  builder.create().show();
  </code></pre>
  
  <p>To make a long story short, when I use the options menu I need to use onClickListener between different void methods. Therefor I can not call <strong><code>AlertDialog.Builder builder = new AlertDialog.Builder(this);</code></strong>. Ive tried to call <strong><code>AlertDialog.Builder builder = new AlertDialog.Builder(getApplicationContext());</code></strong> but it is not working. To be honest I dont realy understand the problem?. </p>
  
  <p>I will type more code in case someone is interested:</p>
  
  <pre><code>public void setListInputMethod()
  {
       for( EditText et : mEditTextList )
       {
           et.setEnabled(false);
           et.setOnClickListener(mTouchTextFieldListener);
       }
  }
  
  private OnClickListener mTouchTextFieldListener = new OnClickListener()
  {
       EditText et;
       public void onClick(View v) 
       {
           et = (EditText)v;
  
           final CharSequence[] items = {"1", "2", "3"};
           AlertDialog.Builder builder = new AlertDialog.Builder(getApplicationContext());
           builder.setTitle("Pick a hcp");
           builder.setItems(items, new DialogInterface.OnClickListener()
           {
              public void onClick(DialogInterface dialogInterface, int item) 
              {
                  et.setText(items[item]);
                  Toast.makeText(getApplicationContext(), items[item], Toast.LENGTH_SHORT).show();
  
                   return;
               }
           });
           builder.create().show(); 
       }
   };
  </code></pre>
  
  <p>This method loops all edit-texts in the app and tries to set the popup dialog as input, but its not working as described above. Realy need advice, thx in advance!</p>