TextView textView = findViewById(R.id.text_view); textView.setEnabled(false);
TextView textView = findViewById(R.id.text_view); if (someCondition) { textView.setEnabled(true); }In this example, the TextView control is enabled only if the "someCondition" is true. Package library: android.widget