Pause Game Android onStop

I know how to pause the game in blueprints. But what i want is to call a custom event when android suspends the app, To bring up the pause menu. This happens when the application is no longer visible. Its placed in a suspended state via onStop which is called in the GameActivity Java file for Android. This could happen as a result of pressing the Home button or receiving a phone call ect.

If i were coding in Java i would just place a custom function under onStop to call the event elsewhere in the Java code. I’m unsure how to accomplish this with UE4. I can set the custom event in the java file. But how do i get the engine to listen for this event, so i can then call whatever event i want in my BluePrint. In this case a UMG widget for the pause screen.

For example your playing your game and you hit the home button. The pause screen is brought up when Android puts the game in suspend state. When you bring the app up again as long as Android has not killed the process its paused and has the UI for being paused brought up.

I know this is in the blueprints section and that’s because my game has been created entirely in blueprints thus far. I am however comfortable with doing this in C++ if necessary i just need pointed in the right direction.

1 Like

Bump - I’d like an answer too!

You can add a Application Lifecycle Component to an object then bind a custom event to ApplicationWillEnterBackgroundDelegate