Android : issue with ImageButton(cant change the background)

on Tuesday, March 31, 2015



int num++;
img.setBackgroundResource(R.drawable.card +num);


my pictures are in the drawable folder and they are ok! the problem is that i cant use R.drawable.card_1 ! how can i solve this!?


i've already tried the code below



int num++;
img.setBackfroundResource("R.drawable.card_"+num);


but its not working either!


one of my pictures name is card_1 to card_10 i want when user clicked on Next button the next picture comes!


0 comments:

Post a Comment