import android.content.Context;
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;
class Main {
public static void showKeyboard(final Context context, final EditText input) {
// Never explicitly open soft keyboard if physical keyboard is present
input.post(new Runnable() {
public void run() {
InputMethodManager imm = (InputMethodManager) context
.getSystemService(Context.INPUT_METHOD_SERVICE);
imm.showSoftInput(input, InputMethodManager.SHOW_FORCED);
}
});
}
}