android - Why i need call view.postRunnable to show keyboard -


i have logic this: when enter edit activity, show popup first, show soft keyboard in ondismisslistener callback, when call showkeyboard directly in callback, soft keyboard doesn't show. call view.postrunnable, show expected. activity softkeyboard option set android:windowsoftinputmode="statehidden|adjustresize"

private void showkeyboard() {     inputmethodmanager imm = (inputmethodmanager)             getsystemservice(context.input_method_service);     imm.showsoftinput(medittext, inputmethodmanager.show_implicit); } 

unless deep knowledge of inner gears of ui framework come answer, everyone's answer "best guess". below best guess:

that related window , windowmanager , how interact views , keyboards.

the edittext being passed method have token activity window, , here guess:

if window not in foreground, can't show keyboard. when post method call, method gets executed after window popup gone, , window activity in foreground.


Comments

Popular posts from this blog

How to provide Authorization & Authentication using Asp.net, C#? -

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

How to use Authorization & Authentication in Asp.net, C#? -