R rgrlee71 Member Licensed User Longtime User Mar 15, 2011 #1 If you use a statelist style button to change to a different activty (using StartActivity) the states reverse on returning to the activity that originated the button press. Meaning when the activity is returned back to the originator the "enabled drawable" and the "pressed drawable" states are reversed. (the colors) This only happens with two buttons in my app that switch the activities back and forth. Also of note is that I'm using the button_down event instead of the button_click event to bypass the android "audible selection" setting. All the other buttons function fine under the same criteria. (other than using StartActivity) Last edited: Mar 16, 2011
If you use a statelist style button to change to a different activty (using StartActivity) the states reverse on returning to the activity that originated the button press. Meaning when the activity is returned back to the originator the "enabled drawable" and the "pressed drawable" states are reversed. (the colors) This only happens with two buttons in my app that switch the activities back and forth. Also of note is that I'm using the button_down event instead of the button_click event to bypass the android "audible selection" setting. All the other buttons function fine under the same criteria. (other than using StartActivity)
Erel B4X founder Staff member Licensed User Longtime User Mar 16, 2011 #2 Can you create a small example and upload it?
R rgrlee71 Member Licensed User Longtime User Mar 16, 2011 #3 I attached an app with two activities. Each activity has two buttons using the statelist style. Both buttons do the same thing (switch to the other activity). One button is using the "click" event. The other is using the "down" event. The click event button works fine it's the down event button that gets reversed. The pressed state color is black to show it more dramatically. It does it on the emulator and my Galaxy S and it definitely has to do with the "down" event. Attachments statelistBUG.zip statelistBUG.zip 7 KB · Views: 474 Last edited: Mar 16, 2011
I attached an app with two activities. Each activity has two buttons using the statelist style. Both buttons do the same thing (switch to the other activity). One button is using the "click" event. The other is using the "down" event. The click event button works fine it's the down event button that gets reversed. The pressed state color is black to show it more dramatically. It does it on the emulator and my Galaxy S and it definitely has to do with the "down" event.
Erel B4X founder Staff member Licensed User Longtime User Mar 18, 2011 #4 I see the strange behavior. Thank you for posting this example. However there is no bug here. The button is left in the 'down' state because you started a new activity (this is the native view behavior) and therefore it stays black. You can instead use Up event and it will work as expected.
I see the strange behavior. Thank you for posting this example. However there is no bug here. The button is left in the 'down' state because you started a new activity (this is the native view behavior) and therefore it stays black. You can instead use Up event and it will work as expected.