Answers for "soft keyboard android not detecting touch"

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 "soft keyboard android not detecting touch"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language