EditText: SoftKeyboard in Custom AlertDialog
<p>I've implemented a popup dialog with a EditText element inside. I can't get Softkeyboard shown on the screen and due to it unable to fill the EditText element. The problem is pretty well known, but still I can't get it working. I've tried different options for solving this issue - see onCreate method. Thanks.</p>

<pre><code>public class MyPopup extends AbstractPlainPopup {
    protected Context _context;

    public CreatePlaylistPopup(Context context) {
        super(context);
        _context = context;
    }

    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        LayoutInflater inflater = getLayoutInflater();
        View container = inflater.inflate(R.layout.popup_new_playlist, null);

        final EditText titleInput = (EditText) container.findViewById(R.id.my_text_view);
        titleInput.setOnFocusChangeListener(new View.OnFocusChangeListener() {
            @Override
            public void onFocusChange(View v, boolean hasFocus) {
                if (hasFocus) {
                    InputMethodManager mgr = (InputMethodManager) _context.getSystemService(Context.INPUT_METHOD_SERVICE);
                    mgr.showSoftInput(titleInput, InputMethodManager.SHOW_IMPLICIT);
                    //getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);
                    //MyPopup.this.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);



                }
            }
        });
        container.findViewById(R.id.cancelButton).setOnClickListener(
                new onCancelClick());
        container.findViewById(R.id.createButton).setOnClickListener(
                new onCreateClick());
        setContentView(container);
    }
    abstract public class AbstractPlainPopup extends AlertDialog implements Observable {

        public final static int CANCEL = 0;
        public final static int OK = 1;

        protected int _state;

        protected ArrayList&lt;Observer&gt; observers = new ArrayList&lt;Observer&gt;();

        public AbstractPlainPopup(Context context){
            super(context);
        }


    public AbstractPlainPopup(Context context, boolean cancelable, OnCancelListener cancelListener) {
        super(context, cancelable, cancelListener);
    }
</code></pre>
