Java tutorial
//package com.java2s; /** * Copyright (c) 2012 Todoroo Inc * * See the file "LICENSE" for the full license governing this code. */ import android.text.InputType; import android.widget.TextView; public class Main { /** Suppress virtual keyboard until user's first tap */ public static void suppressVirtualKeyboard(final TextView editor) { final int inputType = editor.getInputType(); editor.setInputType(InputType.TYPE_NULL); editor.setOnTouchListener((v, event) -> { editor.setInputType(inputType); editor.setOnTouchListener(null); return false; }); } }