I have an hybrid mobile app that works perfectly on the i-phone, but Android phones behave differently when the user swipe closes the application instead of explicitly logging out.
When I reopen the app on the Android, it automatically logs in.
I don't mind if this happens, but the java script that I emit on the OnLogin event fails to work. I know the component is executing the java script because I inserted an alert message, but the setting of values does not work. When I explicitly login, the setting of values execute as expected.
Here is an example of the javascript I am emitting in the OnLogin server event.
e.javascript = "{dialog.Object}.setValue('whatEmployeeID','" + convert_type(vwhatEmployeeID,"c") + "',true); "

My approach to solve this problem is to prevent the auto login behavior by trapping the e.flagUserWasAlreadyLoggedIn flag on the beforelogin server event and explicitly log the user out with the A5WS_LogoutUser() function. This would force the Android user to login again after a swipe close.

I get an error that the e.flagUserWasAlreadyLoggedIn subelement is not found when the code below is executed in a UX componenet which has integrated login functionality checked.

function beforeLogin as v (e as p)
if e.flagUserWasAlreadyLoggedIn = .t. then
end if

Note: I tried putting this code in the OnLogin event and it appears to solve the Android auto login but this caused other unexpected behaviors in my application so I don't believe that is the correct place to handle this situation.

Any help on this would be greatly appreciated.