listview - Android KeyBoard doesn't show in AlertDialog -
I have tried many ways but I can not see any keyboard in my activity. The keyboard just does not show !!! I have a button in my activity, when it calls the way it is clicked, which creates a list below which is an edittext inside and outside a list view (in the header).
I would like the user to enter a letter in the text and the array adapter will be filtered and only show relevant results. So everything works well that no keyboard is shown so that you can not enter a text in a lesson. Here's the code:
private void buildDialog (final int cual) {// communicate que va mostrar una Lista de customer o articulos AlertDialog.Builder now = new AlertDialog.Builder (this); If (cual == 1) {mAdapter2 = new event adapter (this, clients); } And if (cual == 2) {mAdapter2 = new eventadapter (this, vectors); } Lv2 = new list view (this); Edi = new edit text (this); Edi.setHint ("Aspiris a Asbear"); Edi.addTextChangedListener (filterTextWatcher); Lv2.addHeaderView (EDI); Lv2.setAdapter (mAdapter2); lv2.setOnFocusChangeListener (New OnFocusChangeListener () {@Override see public void onFocusChange (V, boolean hasFocus) {if (v.equals (EDI) & amp; & amp ;. hasFocus == true) {alertDialog.getWindow () setSoftInputMode ( WindowManager. Layout paragraph SOFT_INPUT_STATE_ALWAYS_VISIBLE);}}}); Ab.setView (LV2); AlertDialog = ab.create (); alertDialog.setButton (. getResources () GetString (R.string.cancelar), New DialogInterface.OnClickListener () {@Override public void onClick (DialogInterface dialog, int which) {dialog.dismiss ();}}); AlertDialog.show (); } In the manifestation I am in this activity:
When the dialog is opened convey then turns editing Jangte color to get focus and when I made the right Fovs state or wrong as wrong
Things I've tried and do not work: * Delete the list view to cancel the button * Dittext instead of adding the Focus listener directly but it does not help * this code for alertDialog. alertDialog.requestFeature () addContentView (EDI, new LinearLayout.LayoutParams (LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
- Instead of adding them to the onclicklisteners but the same effect ...
- Trying with: // EDI. SetFocusable (true); //edi.setFocusableInTouchMode(true); //edi.requestFocus ();
* Deleting edi.addTextChangedListener (filterTextWatcher); (Who knows that maybe 2 listeners were too much for them) but this does not work, but nothing works, and I have examined other links with this kind of problem but there is no solution either. Or it does not work for me:
[
Any advice would be welcome or is there something wrong? Thanks a lot,
I resolved it!
dialog dialog = new dialog (this); If (cual == 1) {mAdapter2 = new event adapter (this, clients); } And if (cual == 2) {mAdapter2 = new eventadapter (this, vectors); } Lv2 = new list view (this); Edi = new edit text (this); Lv2.addHeaderView (EDI); Lv2.setAdapter (mAdapter2); Dialog.setContentView (LV2); Dialog.setCancelable (true); Dialog.show (); Should not use just a simple dialogue AlerertDialog Plus Builder ....
Comments
Post a Comment