0

i'm trying to pop up the alertdialog in inputmethodservice i've a edit text in the alertdialog it's popping out properly but nothing happens on the edit text focus please help me

 `AlertDialog.Builder builder = new AlertDialog.Builder(this);
 builder.setTitle("Make your selection");
 input = new EditText(this);
 input.setId(1);
 input.requestFocus();
 builder.setView(input);
 AlertDialog alert = builder.create();
 Window window = alert.getWindow();
 WindowManager.LayoutParams lp = window.getAttributes();
 lp.token = mInputView.getWindowToken();
 lp.type = WindowManager.LayoutParams.TYPE_APPLICATION_ATTACHED_DIALOG;
 window.setAttributes(lp);
 window.addFlags(WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM);
 alert.show();
 }`

Is there something i'm missing?

Osama Aftab
  • 7
  • 1
  • 8

1 Answers1

0

As u already mentioned requestfocus(), Just try to add the below line and try once..because it worked for me.

dialog.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE|WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM);

jettimadhuChowdary
  • 1,058
  • 1
  • 13
  • 23