Issue
Is there any way to switch TextView
background when I press a button?
The background are in the drawable folder, I need something like this:
public void ChangeBG(){
Button mybutton = (Button) findViewById(R.id.button1);
mybutton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
//SET R.DRAWABLE.BG2 AS BACKGROUND
}
});
}
Solution
i think its simple
textView.setBackgroundResource(R.drawable.your_image);
Answered By - Moubeen Farooq Khan
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.