Letting end-user uses back button to close LongRange (Android)

Please mark posts as being for RPG or RDMLX (LANSA) developers.
To subscribe by email, display this forum, scroll to the end and select ‘Subscribe Forum’.
Post Reply
tsupartono
Posts: 289
Joined: Wed Apr 18, 2012 10:21 am

Letting end-user uses back button to close LongRange (Android)

Post by tsupartono » Thu Oct 01, 2015 8:10 am

This tip applies only to LongRange for Android.

By default, when you press the device's back button, you'd get an error message "There is nothing to go back to". You or your customer may want to change this behaviour so that it is more in line with other Android apps, that is, to close the application.

The behaviour of the back button in Android is controlled by two system properties.

1) OnSysBack_AllowNavigateAway (default = false)
Indicates whether pressing the back button can cause LongRange to close.

2) OnSysBack_NavigateAwayNoConfirmation (default = false)
Indicates whether LongRange will ask the user for confirmation when it’s about to close due to the user pressing the back button.

Example how to set system value (RPG):

Code: Select all

LRNG_AssignBoolToProp(*ON : '/SysStates.OnSysBack_AllowNavigateAway');
LRNG_AssignBoolToProp(*ON : '/SysStates.OnSysBack_NavigateAwayNoConfirmation');
Where to set these properties?

In LongRange Studio, go to Schema Properties".
Best to set these in program designated as “local objects generator”

Note - setting these properties on other platforms (iOS, Windows) will not do any harm, so no need to condition them.

Post Reply