Search code examples
androidandroid-edittextandroid-keypad

How to remove keypad from edit text ,but show keypad when click on edit text?


In my app the first view of all my screens is an EditText, so every time I go to a screen the onscreen keypad pops up. how can I disable this popping up and enable it when manually clicked on the EditText???? getActivity().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);

This can be used in Fragment Class to move the Edit text up and Scroll till the end. The problem is that when I click on an EditText the keyboard pops up. I think I have to do it in java. Thank you!!!


Solution

  • You need to set windowSoftInputMode attribute to each activity in AndroidManifest.xml file.

        <activity
            android:name="YourActivityPath"
            android:windowSoftInputMode="stateAlwaysHidden"/>