In my Activity A, I have 8 toggle buttons that the background of them is set within the layout xml to an xml file to change the pictures on change state. After choosing 4 of them, the image strings are saved to a SQLite database. In my Activity B, I am trying to set the background of another set of toggle buttons from the choices made from Activity A. Each of the 8 original toggle buttons has 4 images associated with them. So i have 32 change state xmls but when I try to set the background during if statement, they do not show. The original image strings are saved to a sqlite database in (A) and then retrieved in (B). I know the database retrieval works, its just setting the toggle button background based on the value from the database.
JAVA
if(imgData1 == "img1.png")
{
tbTest1.setBackgroundResource(R.drawable.test1);
tbTest2.setBackgroundResource(R.drawable.test2);
tbTest3.setBackgroundResource(R.drawable.test3);
tbTest4.setBackgroundResource(R.drawable.test4);
}
else if(imgData1 == "img2.png")
{
tbTest1.setBackgroundResource(R.drawable.test5);
tbTest2.setBackgroundResource(R.drawable.test6);
tbTest3.setBackgroundResource(R.drawable.test7);
tbTest4.setBackgroundResource(R.drawable.test8);
}
else if(imgData1 == "img3.png")
{
tbTest1.setBackgroundResource(R.drawable.test9);
tbTest2.setBackgroundResource(R.drawable.test10);
tbTest3.setBackgroundResource(R.drawable.test11);
tbTest4.setBackgroundResource(R.drawable.test12);
}
else if(imgData1 == "img4.png")
{
tbTest1.setBackgroundResource(R.drawable.test13);
tbTest2.setBackgroundResource(R.drawable.test14);
tbTest3.setBackgroundResource(R.drawable.test15);
tbTest4.setBackgroundResource(R.drawable.test16);
}