Hello guys,
I want to change the hint of an editText-inputfield for two seconds, if the user inserts wrong data.
I tried to do something like this:
But the program crashes (I guess it's because of the InterruptionException / .sleep()). How can I fix it? I know there is an easy way, but I can't figure it out write now.
Kind regards and thanks for your responses.
F.S.
I want to change the hint of an editText-inputfield for two seconds, if the user inserts wrong data.
I tried to do something like this:
Java:
new Thread() {
@Override
public void run() {
try {
input1.setHint(R.string.emptyEditTextFieldHint);
input2.setHint(R.string.emptyEditTextFieldHint);
this.sleep(2000);
} catch (InterruptedException e) {
} finally {
input1.setHint(R.string.input1Hint);
input2.setHint(R.string.input2Hint);
return;
}
}
}.start();
But the program crashes (I guess it's because of the InterruptionException / .sleep()). How can I fix it? I know there is an easy way, but I can't figure it out write now.
Kind regards and thanks for your responses.
F.S.
