I have a loginscreen.
In this loginscreen I have a button that is by default disabled.
When the user has entered 4 numbers I enable the button and change the textcolor to green.
But when the 4 numbers are not the correct code I clear my edittext and disable my button again.
At the moment the textcolor of this disabled button is offcourse green.
How can I set it back to the default color?
public void onTextChanged(CharSequence s, int start, int before, int count) {
if(s.length() >= maxLength)
{
btnOk.setEnabled(true);
btnOk.setTextColor(Color.parseColor("#00B32D"));
}
else
{
btnOk.setEnabled(false);
}
private void checkIfValid(String inputPin)
{
if(inputPin.equals("0000"))
{
startActivity(new Intent(this, ShowScreenActivity.class));
finish();
}
else
{
clearText();
====> //Here i want to set my textcolor back to normal.
Toast.makeText(this, "Pincode foutief", Toast.LENGTH_SHORT).show();
}
}
Get the default color of Button using this code,
If its not what you are looking for, then you can get Android Platform Resource Color using
something like,
Check others too…