Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

how to set default focus on edittext in android

 etSearch.requestFocus();
 public void showSoftKeyboard(View view) {
        if (view.requestFocus()) {
            InputMethodManager imm = (InputMethodManager)
                  getSystemService(Context.INPUT_METHOD_SERVICE);
           imm.showSoftInput(view, InputMethodManager.SHOW_IMPLICIT);
     }
  }
  
  menifest:
 android:windowSoftInputMode="stateVisible"
 
PREVIOUS NEXT
Tagged: #set #default #focus #edittext #android
ADD COMMENT
Topic
Name
2+9 =