BarryW Active Member Licensed User Longtime User Jan 30, 2020 #1 I have a sample app here which has two activity. The first activity has one button with name Button1 and the second activity has two buttons with name Button1 and Button2. On create event on both page, I used a helper function to change their background with statelistdrawable. The problem is when second page is loaded and then back to first page then button on first page inherits the design or background of button from second page with same name.. I add the screenshot from first page to second page then back to first page. I also add the sample program re-created from the bug i was encountered... Attachments 83598669_804560273346194_9012398450091753472_n.jpg 12.7 KB · Views: 366 83363713_292319181731133_2323136488872607744_n.jpg 14.1 KB · Views: 407 83573054_778464209329823_1388633325605748736_n.jpg 11.3 KB · Views: 422 2020_01_30.zip 2020_01_30.zip 448 KB · Views: 404
I have a sample app here which has two activity. The first activity has one button with name Button1 and the second activity has two buttons with name Button1 and Button2. On create event on both page, I used a helper function to change their background with statelistdrawable. The problem is when second page is loaded and then back to first page then button on first page inherits the design or background of button from second page with same name.. I add the screenshot from first page to second page then back to first page. I also add the sample program re-created from the bug i was encountered...
Erel B4X founder Staff member Licensed User Longtime User Jan 30, 2020 #2 This is not a bug. You should never reuse drawables. For further discussion please start a new thread in the questions forum.
This is not a bug. You should never reuse drawables. For further discussion please start a new thread in the questions forum.
LucaMs Expert Licensed User Longtime User Jan 30, 2020 #3 Just a very little ? comment: I go crazy seeing names like Button1; even duplicates!
DonManfred Expert Licensed User Longtime User Jan 30, 2020 #4 You are reusing drawables which is a mistake. Attachments 2020_01_30new.zip 2020_01_30new.zip 11.1 KB · Views: 360
BarryW Active Member Licensed User Longtime User Jan 30, 2020 #5 LucaMs said: Just a very little ? comment: I go crazy seeing names like Button1; even duplicates! Click to expand... just a means of a sample Mr. Expert, trying to explore things..
LucaMs said: Just a very little ? comment: I go crazy seeing names like Button1; even duplicates! Click to expand... just a means of a sample Mr. Expert, trying to explore things..
BarryW Active Member Licensed User Longtime User Jan 30, 2020 #6 BarryW said: just a means of a sample Mr. Expert, trying to explore things.. Click to expand... B4X: dim dakbhikgbjnfgjsejiehilewjiehnilugfuyaglwuhrfbalfhbwfliwbfwlifbwf as button ?
BarryW said: just a means of a sample Mr. Expert, trying to explore things.. Click to expand... B4X: dim dakbhikgbjnfgjsejiehilewjiehnilugfuyaglwuhrfbalfhbwfliwbfwlifbwf as button ?