Answers for "keyboard android hide android"

0

how to open soft keyboard in android programmatically

class MainActivity: AppCompatActivity() {

	override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_message)
		val editTextMessage = findViewById<EditText>(R.id.myEditeText)
      	showSoftKeyboard(this, editTextMessage)
    }


  	private fun showSoftKeyboard(context: Context, v: View) {
    	val iim = context.getSystemService(Activity.INPUT_METHOD_SERVICE) as InputMethodManager
    	if (v.requestFocus()) {
      		iim.showSoftInput(v, InputMethodManager.SHOW_IMPLICIT)
    	}
  	}
}
Posted by: Guest on November-16-2020

Code answers related to "keyboard android hide android"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language