241
Views
6
Comments
Solved
Mobile OnApplicationResume change screen variable
Question

Hi Everyone. 


Is it possible to change screen variable when application comes from background to foreground ?

I want to show block screen each time application comes from background to foreground. 


Regards,

Anahit 


2025-06-03 16-30-12
bfcantante
Solution

Hi,

You can add an event in your layout (On Ready):


document.addEventListener("resume", $actions.TriggerOnResume, false);

The action TriggerOnResume should launch an event:


And when you receive this event you can change the content of the screen and show your block.


Additionally it is good practice to remove the event in ondestroy:


More about cordova events:

https://cordova.apache.org/docs/en/latest/cordova/events/events.html


2019-02-21 09-18-54
Anahit Pahlevanyan

bfcantante wrote: Hi . Thank you very much for your help. it works.

Hi,

You can add an event in your layout (On Ready):


document.addEventListener("resume", $actions.TriggerOnResume, false);

The action TriggerOnResume should launch an event:


And when you receive this event you can change the content of the screen and show your block.


Additionally it is good practice to remove the event in ondestroy:


More about cordova events:

https://cordova.apache.org/docs/en/latest/cordova/events/events.html




UserImage.jpg
Harish Yerra

Hi 

If i write document.addEventListener("resume",$actions.OnResume,false) in onReady and document.removeEventListener("resume",$actions.OnResume,false) in onDestroy i am getting unknown actions. Please let me know where i am doing mistake.

Thanks

Harish

UserImage.jpg
Harish Yerra

how to use it ., i installed it and tried to drag the onResume component but unable to add. And also i don't have any ui change i need to perform action.

bfcantante wrote:

Hi,

Try: https://www.outsystems.com/forge/component-overview/3408/mobile-events

Regards.



2024-01-05 16-00-17
Filipe Lourenço

Any way to work in pwa?

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.