EditText myEditText = findViewById(R.id.myEditText); myEditText.setCursorVisible(true);
EditText myEditText2 = new EditText(context); myEditText2.setCursorVisible(false);This code creates a new EditText widget and sets its cursor invisible. Package library: android.widget - this is a part of the Android SDK itself.