Android show soft keyboard when fragment onResume -


i trying show keyboard when screen edittext in foreground.. found 2 solutions, surprisingly, both work on cases , not other..

i have 2 fragments, first fragment shows keyboard when call showsoftkeyboard1 , second fragment works if call showsoftkeyboard2. both called inside onresume();

public static void showsoftkeyboard1(context activity, view view) {     if (view == null) return;     view.requestfocus();     inputmethodmanager imm = (inputmethodmanager) activity.getsystemservice(context.input_method_service);     imm.showsoftinput(view, inputmethodmanager.show_forced); }  public static void showsoftkeyboard2(activity activity, view view) {     if (view == null) return;     if (view.requestfocus()) {         activity.getwindow().setsoftinputmode(                 windowmanager.layoutparams.soft_input_state_always_visible);     } } 

i wonder difference between these 2 methods?!


Comments

Popular posts from this blog

java - Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved -

Round ImageView Android -

How can I utilize Yahoo Weather API in android -