keyboard - Android EditText focus inside of Fragment within ScreenSlidePageAdapter -
[using support library]
when attempting use edittext inside of fragment in screenslidepageradapter in multiple fragments visible @ once.
the second fragment in list contains edittext. on android 4.1 & 4.2 works fine. on android 2.3.6 (don't know other versions), tapping edittext bring on screen keyboard, not focus edittext. if drag within screenslidepageradapter in such way fragment becomes considered "current", edittext behave correctly.
a fixed layout not acceptable, must generated dynamically , number of fragments visible can vary based on different criteria.
any ideas on how behave correctly , without hard-coding?
the
if (v == tv) of prior comment needs concerned focus
if (v == tv && hasfocus) full code:
if (v == tv && hasfocus) { ((lobbyact)chatfragment.this.getactivity()).pager.setcurrentitem(1); inputmethodmanager inputmgr = (inputmethodmanager)getactivity().getsystemservice(context.input_method_service); inputmgr.togglesoftinput(0, 0); }
Comments
Post a Comment