I have a quite simple Layout with an EditText and a button. The problem is the keyboard appears immediately after the activity is started and the EditText gets the focus. I
From my POV a more elegant solution is:
In XML add these lines to the main layout:
And In Java in onCreate():
LinearLayout mainLayout = (LinearLayout) findViewById(R.id.mainLayout); mainLayout.requestFocus();