Skip to content Skip to sidebar Skip to footer

Android Dynamically Setting A 9-patch Background On Edittext Widget

firstly thank you for taking the time to read this. So I have created three 9-patch files which are working correctly as I can set them in XML on my registration form I've created

Solution 1:

It seems to me that you put this line:

NinePatchDrawableeditTextError= (NinePatchDrawable) getResources().getDrawable(R.drawable.edittext_not_filled_in);

in the class body, where you declare the field. narrow it down to

NinePatchDrawable editTextError;

and then in onCreate put

editTextError = (NinePatchDrawable) getResources().getDrawable(R.drawable.edittext_not_filled_in);

This should solve your problem.

Post a Comment for "Android Dynamically Setting A 9-patch Background On Edittext Widget"