onContextItemSelected to Dialog
<p>I get this error when i am selecting a ContextMenu Item to pop up a custom Dialog.</p>

<pre><code> W/InputManagerService(59): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@44f518c0
</code></pre>

<p>Code below </p>

<pre><code>  public boolean onContextItemSelected(MenuItem item) {
    AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo();
    Map&lt;String, String&gt; data = (Map&lt;String, String&gt;) getListView().getItemAtPosition(info.position);
    preferences = PreferenceManager.getDefaultSharedPreferences(this);
    String user_ids = preferences.getString("userID", null);
    switch (item.getItemId()) {
    case R.id.pm:
        pms(data.get("pid"),user_ids,data.get("Name"));
        return true;
    }
    return super.onContextItemSelected(item);
  }

private void pms(final String fu2, final String to,final String to2) {
    dialog = new Dialog(this.getParent());
    dialog.setContentView(R.layout.popup_reply);
    dialog.setTitle("To: "+to2);
    dialog.setCancelable(true);
    preferences = PreferenceManager.getDefaultSharedPreferences(this);
    body = (EditText) dialog.findViewById(R.id.editText2);
    sub = (EditText) dialog.findViewById(R.id.editText1);

    Button button = (Button) dialog.findViewById(R.id.Button01);
    button.setOnClickListener(new OnClickListener() {
        @Override
            public void onClick(View v) {
            dialog.dismiss();
            }
        });
    Button button2 = (Button) dialog.findViewById(R.id.Button02);
    button2.setOnClickListener(new OnClickListener() {
        @Override
            public void onClick(View v) {
            new ADownloadFileAsync().execute(fu2);
        }
        });
    dialog.show();
}
</code></pre>

<p>I am only assuming that the Contextmenu is not out of focus before it calls the dialg. Because I can call the dialog from a button just fine.</p>
