Rajesh Panchal
Rajesh Panchal

Reputation: 1170

soft keyboard is not opening while popup window is open

I have created custom popup with edittext on it, while i am trying to write something in edittext soft keyboard is not appearing,

my code,

public void popUpCreateList(final View v) {

    View popupView;

    final EditText et_list_name;
    Button b_add;

    LayoutInflater layoutInflater = (LayoutInflater) mContext
            .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    popupView = layoutInflater.inflate(R.layout.dialog_create_list, null);
    popup_create_list = new PopupWindow(popupView,
            WindowManager.LayoutParams.FILL_PARENT,
            WindowManager.LayoutParams.FILL_PARENT, false);

    et_list_name = (EditText) popupView
            .findViewById(R.id.dialog_friend_create_list_edt_list_name);
    b_add = (Button) popupView
            .findViewById(R.id.dialog_friend_create_list_btn_add_list);


    new Handler().postDelayed(new Runnable() {

        public void run() {
            popup_create_list.showAtLocation(v, Gravity.NO_GRAVITY, 0, 0);
            popup_create_list.update();
            popup_create_list.setFocusable(true);
        }

    }, 100L);



}

Help me to resolve the problem, Thanks in advance.

Upvotes: 1

Views: 716

Answers (1)

IntelliJ Amiya
IntelliJ Amiya

Reputation: 75788

You can try this .

  1. Your_EditText_Obj.requestFocus();

  2. Your_EditText_Obj.setFocusable(true);

  3. Did you set android:windowSoftInputMode="stateVisible

Soft keyboard doesn't appear

Upvotes: 2

Related Questions