Link will be apear in 30 seconds.
Well done! you have successfully gained access to Decrypted Link.
Question:
create a Edit Text to read a number. write codes for the below.
a)get the view of EditText.
b)Create three notifications notification1,notification2,notification3 with three different content but same title
c)if the number entered in edittext is 1,display notification1,if number is 2, display notification 2 and if number is 3 display notification 3
Answer:
private void setupFloatingLabelError() {
final TextInputLayout floatingUsernameLabel = (TextInputLayout) findViewById(R.id.username_text_input_layout);
floatingUsernameLabel.getEditText().addTextChangedListener(new TextWatcher() {
// ...
@Override
public void onTextChanged(CharSequence text, int start, int count, int after) {
if (text.length() > 0 && text.length() <= 4) {
floatingUsernameLabel.setError(getString(R.string.username_required));
floatingUsernameLabel.setErrorEnabled(true);
} else {
floatingUsernameLabel.setErrorEnabled(false);
}
}
@Override
public void beforeTextChanged(CharSequence s, int start, int count,
int after) {
// TODO Auto-generated method stub
}
@Override
public void afterTextChanged(Editable s) {
}
});