In my settings activity, I want to check if the Edittextpreference is empty, before exiting the activity, clicking on the android.R.id.home button or on the back button of the device. If the edittextpreference is empty, I have to do something, like change its background color, and avoid the user to exit settings. But the problem is that if i have two edittextpreference, and only one is empty, one edittextpreference has to be with different background, and the other needs to be as it was.
Is there any way to do this? Maybe if it is not possible using the equivalent of edittext.setError()
?
Asked
Active
Viewed 100 times
1

Davide Cenedese
- 110
- 1
- 2
- 9