Re: [android-developers] DialogFragment - show soft keyboard upon creation
Ok, all is working now. The problem came from wanting to only enable the ok button once a minimum number of characters had been entered. I was doing this through setOnKeyListener - this blocked the soft keyboard appearing automatically (if the user touched the edittext, the soft keyboard showed anyway). So, I have removed this call and now use the following with success : getDialog().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE); On Monday, 16 July 2012 19:49:18 UTC+2, MagouyaWare wrote: Do any of these attributes help? In particular I am thinking of the stateVisible or stateAlwaysVisible options: http://developer.android.com/guide/topics/manifest/activity-element.html#wsoft Thanks, Justin Anderson MagouyaWare Developer http://sites.google.com/site/magouyaware On Mon, Jul 16, 2012 at 11:46 AM, dnkoutso wrote: Everything around the Android keyboard feels hacky. Try one of the following: 1) Set requestFocus/ in your XML in the edittext. 2) do a post such as et.post(new Runnable() { et.requestFocus() }} etc. 3) do a post again but your use own code in your original post. Good luck. On Monday, July 16, 2012 9:26:40 AM UTC-7, Simon Giddings wrote: Yes, I use this as well, but forgot to include it in the code I posted here. On Monday, 16 July 2012 18:06:41 UTC+2, Kostya Vasilyev wrote: Have you tried et.requestFocus() ? 2012/7/16 Simon Giddings I have a simple dialog built with the compatibility libraries DialogFragment. It holds only 1. EditText 2. 2 buttons When the dialog is shown, the edit text control has the focus. At this point, I want to open the soft keyboard automatically. Here is what I am doing within the onCreateView method : EditText et; et = (EditText)v.findViewById(R.id.**txtAddress); Activity act = getActivity(); if(act != null) { InputMethodManager imm = (InputMethodManager)act.** getSystemService(Context.**INPUT_METHOD_SERVICE); if(imm != null) imm.showSoftInput(et, InputMethodManager.SHOW_**FORCED); } Even though I get to the showSoftInput step with no problem, the keyboard is still not displayed. So, how can I correctly get the soft keyboard to be shown ? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@** googlegroups.com android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+**unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/**group/android-developers?hl=enhttp://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] DialogFragment - show soft keyboard upon creation
I have a simple dialog built with the compatibility libraries DialogFragment. It holds only 1. EditText 2. 2 buttons When the dialog is shown, the edit text control has the focus. At this point, I want to open the soft keyboard automatically. Here is what I am doing within the onCreateView method : EditText et; et = (EditText)v.findViewById(R.id.txtAddress); Activity act = getActivity(); if(act != null) { InputMethodManager imm = (InputMethodManager)act.getSystemService(Context.INPUT_METHOD_SERVICE); if(imm != null) imm.showSoftInput(et, InputMethodManager.SHOW_FORCED); } Even though I get to the showSoftInput step with no problem, the keyboard is still not displayed. So, how can I correctly get the soft keyboard to be shown ? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] DialogFragment - show soft keyboard upon creation
Have you tried et.requestFocus() ? 2012/7/16 Simon Giddings mr.s.giddi...@gmail.com I have a simple dialog built with the compatibility libraries DialogFragment. It holds only 1. EditText 2. 2 buttons When the dialog is shown, the edit text control has the focus. At this point, I want to open the soft keyboard automatically. Here is what I am doing within the onCreateView method : EditText et; et = (EditText)v.findViewById(R.id.txtAddress); Activity act = getActivity(); if(act != null) { InputMethodManager imm = (InputMethodManager)act.getSystemService(Context.INPUT_METHOD_SERVICE); if(imm != null) imm.showSoftInput(et, InputMethodManager.SHOW_FORCED); } Even though I get to the showSoftInput step with no problem, the keyboard is still not displayed. So, how can I correctly get the soft keyboard to be shown ? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] DialogFragment - show soft keyboard upon creation
Yes, I use this as well, but forgot to include it in the code I posted here. On Monday, 16 July 2012 18:06:41 UTC+2, Kostya Vasilyev wrote: Have you tried et.requestFocus() ? 2012/7/16 Simon Giddings I have a simple dialog built with the compatibility libraries DialogFragment. It holds only 1. EditText 2. 2 buttons When the dialog is shown, the edit text control has the focus. At this point, I want to open the soft keyboard automatically. Here is what I am doing within the onCreateView method : EditText et; et = (EditText)v.findViewById(R.id.txtAddress); Activity act = getActivity(); if(act != null) { InputMethodManager imm = (InputMethodManager)act.getSystemService(Context.INPUT_METHOD_SERVICE); if(imm != null) imm.showSoftInput(et, InputMethodManager.SHOW_FORCED); } Even though I get to the showSoftInput step with no problem, the keyboard is still not displayed. So, how can I correctly get the soft keyboard to be shown ? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] DialogFragment - show soft keyboard upon creation
Everything around the Android keyboard feels hacky. Try one of the following: 1) Set requestFocus/ in your XML in the edittext. 2) do a post such as et.post(new Runnable() { et.requestFocus() }} etc. 3) do a post again but your use own code in your original post. Good luck. On Monday, July 16, 2012 9:26:40 AM UTC-7, Simon Giddings wrote: Yes, I use this as well, but forgot to include it in the code I posted here. On Monday, 16 July 2012 18:06:41 UTC+2, Kostya Vasilyev wrote: Have you tried et.requestFocus() ? 2012/7/16 Simon Giddings I have a simple dialog built with the compatibility libraries DialogFragment. It holds only 1. EditText 2. 2 buttons When the dialog is shown, the edit text control has the focus. At this point, I want to open the soft keyboard automatically. Here is what I am doing within the onCreateView method : EditText et; et = (EditText)v.findViewById(R.id.txtAddress); Activity act = getActivity(); if(act != null) { InputMethodManager imm = (InputMethodManager)act.getSystemService(Context.INPUT_METHOD_SERVICE); if(imm != null) imm.showSoftInput(et, InputMethodManager.SHOW_FORCED); } Even though I get to the showSoftInput step with no problem, the keyboard is still not displayed. So, how can I correctly get the soft keyboard to be shown ? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] DialogFragment - show soft keyboard upon creation
Do any of these attributes help? In particular I am thinking of the stateVisible or stateAlwaysVisible options: http://developer.android.com/guide/topics/manifest/activity-element.html#wsoft Thanks, Justin Anderson MagouyaWare Developer http://sites.google.com/site/magouyaware On Mon, Jul 16, 2012 at 11:46 AM, dnkoutso dnkou...@gmail.com wrote: Everything around the Android keyboard feels hacky. Try one of the following: 1) Set requestFocus/ in your XML in the edittext. 2) do a post such as et.post(new Runnable() { et.requestFocus() }} etc. 3) do a post again but your use own code in your original post. Good luck. On Monday, July 16, 2012 9:26:40 AM UTC-7, Simon Giddings wrote: Yes, I use this as well, but forgot to include it in the code I posted here. On Monday, 16 July 2012 18:06:41 UTC+2, Kostya Vasilyev wrote: Have you tried et.requestFocus() ? 2012/7/16 Simon Giddings I have a simple dialog built with the compatibility libraries DialogFragment. It holds only 1. EditText 2. 2 buttons When the dialog is shown, the edit text control has the focus. At this point, I want to open the soft keyboard automatically. Here is what I am doing within the onCreateView method : EditText et; et = (EditText)v.findViewById(R.id.**txtAddress); Activity act = getActivity(); if(act != null) { InputMethodManager imm = (InputMethodManager)act.** getSystemService(Context.**INPUT_METHOD_SERVICE); if(imm != null) imm.showSoftInput(et, InputMethodManager.SHOW_**FORCED); } Even though I get to the showSoftInput step with no problem, the keyboard is still not displayed. So, how can I correctly get the soft keyboard to be shown ? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@** googlegroups.com android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+**unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/**group/android-developers?hl=enhttp://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en