Reputation: 1170
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
Reputation: 75788
You can try this .
Your_EditText_Obj.requestFocus();
Your_EditText_Obj.setFocusable(true);
Did you set android:windowSoftInputMode="stateVisible
Upvotes: 2