When I click the button sub the text inside the editText field should be stored as a string in str. And I need to make sure that the text consists of only alphabets. I'm kinda beginner so I don't have much of an experience.
final Button sub = findViewById(R.id.submit);
final EditText name = findViewById(R.id.name);
chk.setEnabled(false);
sub.setOnClickListener(
new View.OnClickListener()
{
public void onClick(View view)
{
str = name.getText().toString();
x = str.length();
if (x>=4 || x<=10)
chk.setEnabled(true);
}
});