# Android Mobile Event end play problem

**URL:** <https://forums.unrealengine.com/t/android-mobile-event-end-play-problem/322076>\
**Category:** Mobile\
**Tags:** Mobile, unreal-engine, Android, question, Blueprint\
**Created:** [June 17, 2015, 1:45am UTC](https://forums.unrealengine.com/t/android-mobile-event-end-play-problem/322076 "2015-06-17T01:45:15Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![Greyrock\_Studios](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Greyrock\_Studios](https://forums.unrealengine.com/u/Greyrock_Studios)\
**Post date:** [June 17, 2015, 1:45am UTC](https://forums.unrealengine.com/t/android-mobile-event-end-play-problem/322076/1 "2015-06-17T01:45:15Z")

</div>

Hello,

I made a blueprint Save Game who saves the Time when Event End plays.  
It works fine on PC but on Mobile it won´t Save or activate the “Event End Play” part on the blueprint

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_e729f54e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_e729f54e](https://forums.unrealengine.com/u/anonymous_user_e729f54e)\
**Post date:** [June 17, 2015, 2:47pm UTC](https://forums.unrealengine.com/t/android-mobile-event-end-play-problem/322076/2 "2015-06-17T14:47:34Z")

</div>

Hello pandagraphy,

I have a few questions for you that will help narrow down what issue it is that you are experiencing.

Quick questions:

1. When you tested this on the device, did you launch on or package it out?
2. What is the exact device that you are using(example: iPhone 5s)?
3. What is that exact OS current installed on the device (example: iOS 8.0.1)
4. Could you provide screen shots of any blueprints that may be involved with this issue?

---

<div class="post-metadata">

**Author:** ![Greyrock\_Studios](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Greyrock\_Studios](https://forums.unrealengine.com/u/Greyrock_Studios)\
**Post date:** [June 17, 2015, 4:24pm UTC](https://forums.unrealengine.com/t/android-mobile-event-end-play-problem/322076/3 "2015-06-17T16:24:29Z")

</div>

Hello,

1. launch it on device

2. Testet on Galaxy S5 and HTC One

3. Version 5.0

Save the Time, when Game Closed on Character Blueprint

 ![46773-saveendtime.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/9/7/99748d2dcdc11d116e572ea99a668aba9eb97ed4.png)

Show Hour and Minute with Widged on Screen. Get it from Save Game Blueprint

 ![46774-widget_time.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/4/8/2487cb932a094a20e47bf33548ad895c119ef80c.png)

works fine on pc

 ![46775-onpc.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/f/e/efe433d66ef5f0f99cce2498101c1f62241e69e1.png)

but didn´t work on mobile

 ![46777-screenshot_2015-06-17-18-14-01.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/c/3/9c375b210a276657a998211a11d39b74c5e9088a.jpeg)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_e729f54e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_e729f54e](https://forums.unrealengine.com/u/anonymous_user_e729f54e)\
**Post date:** [June 17, 2015, 4:51pm UTC](https://forums.unrealengine.com/t/android-mobile-event-end-play-problem/322076/4 "2015-06-17T16:51:18Z")

</div>

Hello pandagraphy,

You will need to package the game out and install it onto the device in order to test the save system. This is because launch on does not include all the files from the game when testing. Could please try packaging out the game and installing it on to the device and provide the results?

---

<div class="post-metadata">

**Author:** ![Greyrock\_Studios](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Greyrock\_Studios](https://forums.unrealengine.com/u/Greyrock_Studios)\
**Post date:** [June 17, 2015, 4:58pm UTC](https://forums.unrealengine.com/t/android-mobile-event-end-play-problem/322076/5 "2015-06-17T16:58:51Z")

</div>

Hello Rudy,

I packaged the game out and installed it on device, got the same problem .

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_e729f54e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_e729f54e](https://forums.unrealengine.com/u/anonymous_user_e729f54e)\
**Post date:** [June 17, 2015, 6:59pm UTC](https://forums.unrealengine.com/t/android-mobile-event-end-play-problem/322076/6 "2015-06-17T18:59:11Z")

</div>

Hello pandagraphy,

I was able to reproduce this issue on our end. I have written up a report (UE-17241) and I have submitted it to the developers for further consideration. I will provide updates with any pertinent information as it becomes available. Thank you for your time and information.

Make it a great day

---

<div class="post-metadata">

**Author:** ![Greyrock\_Studios](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Greyrock\_Studios](https://forums.unrealengine.com/u/Greyrock_Studios)\
**Post date:** [June 17, 2015, 9:19pm UTC](https://forums.unrealengine.com/t/android-mobile-event-end-play-problem/322076/7 "2015-06-17T21:19:37Z")

</div>

Thank you Rudy! =)

---

<div class="post-metadata">

**Author:** ![Chris\_Babcock](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Chris\_Babcock](https://forums.unrealengine.com/u/Chris_Babcock)\
**Post date:** [July 10, 2015, 8:04pm UTC](https://forums.unrealengine.com/t/android-mobile-event-end-play-problem/322076/8 "2015-07-10T20:04:38Z")

</div>

Hello pandagraphy,

Unfortunately on Android it isn’t possible to detect when the application is force closed. The onStop event is triggered from just pausing the application so you won’t want to terminate on it, and onDestroy is only called if in the background and the system needs to kill it for memory, and even then isn’t guaranteed.

The only recommendation is to save any state instead on entering background (paused). There is an application lifecycle event for this called ApplicationWillEnterBackgroundDelegate you may use instead.

---

<div class="post-metadata">

**Author:** ![Greyrock\_Studios](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Greyrock\_Studios](https://forums.unrealengine.com/u/Greyrock_Studios)\
**Post date:** [July 11, 2015, 10:24pm UTC](https://forums.unrealengine.com/t/android-mobile-event-end-play-problem/322076/9 "2015-07-11T22:24:40Z")

</div>

But I don’t know how to use them. If anyone can give me some examples, I would be really grateful.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_e729f54e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_e729f54e](https://forums.unrealengine.com/u/anonymous_user_e729f54e)\
**Post date:** [July 13, 2015, 4:52pm UTC](https://forums.unrealengine.com/t/android-mobile-event-end-play-problem/322076/10 "2015-07-13T16:52:06Z")

</div>

Hello pandagraphy,

Steps to use event:

1. Right click blueprint graph
2. Uncheck context sensitive
3. Type in “Application Will Enter Background Delegate”
4. Choose “Assign Application Will Enter Background Delegate”

I hope that this information helps.

Make it a great day

---

<div class="post-metadata">

**Author:** ![Greyrock\_Studios](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Greyrock\_Studios](https://forums.unrealengine.com/u/Greyrock_Studios)\
**Post date:** [July 13, 2015, 5:25pm UTC](https://forums.unrealengine.com/t/android-mobile-event-end-play-problem/322076/11 "2015-07-13T17:25:48Z")

</div>

Hello Rudy,

thanks for your answer, but i means how to connect it on my blueprint… at which point and with what 🙂

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_e729f54e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_e729f54e](https://forums.unrealengine.com/u/anonymous_user_e729f54e)\
**Post date:** [July 14, 2015, 1:22pm UTC](https://forums.unrealengine.com/t/android-mobile-event-end-play-problem/322076/12 "2015-07-14T13:22:17Z")

</div>

Hello pandagraphy,

In the example provided below I have assigned a custom event on event construct with the Application will enter background delegate event. All this does is turn the custom event into an “ApplicationWillEnterBackgroundDelegate” event. This custom event will now fire off just before the application is sent to the back ground (example: hitting the home button on a mobile device to pull up another app.) I hope that this clears things up a bit

 ![50140-willenterbackgroundhelp.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/9/3/c9357b116a2779c5b63ece97eceae4f3690a4837.png)

Make it a great day

---

<div class="post-metadata">

**Author:** ![Greyrock\_Studios](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Greyrock\_Studios](https://forums.unrealengine.com/u/Greyrock_Studios)\
**Post date:** [July 14, 2015, 6:54pm UTC](https://forums.unrealengine.com/t/android-mobile-event-end-play-problem/322076/13 "2015-07-14T18:54:48Z")

</div>

Thanks Rudy , but if I like you doing this I get an error message.

"This blueprint (self) is not a ApplicationLifecycleComponent, therefore ‘Target’ must have a connection.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_e729f54e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_e729f54e](https://forums.unrealengine.com/u/anonymous_user_e729f54e)\
**Post date:** [July 14, 2015, 8:08pm UTC](https://forums.unrealengine.com/t/android-mobile-event-end-play-problem/322076/14 "2015-07-14T20:08:44Z")

</div>

Hello pandagraphy,

If you hover over the blue pin you will see that you need to add an ApplicationLifecycle component to the actor that you are using.

---

<div class="post-metadata">

**Author:** ![Greyrock\_Studios](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Greyrock\_Studios](https://forums.unrealengine.com/u/Greyrock_Studios)\
**Post date:** [July 20, 2015, 10:45am UTC](https://forums.unrealengine.com/t/android-mobile-event-end-play-problem/322076/15 "2015-07-20T10:45:33Z")

</div>

I’m afraid I do not understand which component you need it and how I include this in my Blueprint

 ![50771-save_time.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/9/2/4921e229b7146c440a5cb185e6c4649e9e0a7e73.png)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_e729f54e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_e729f54e](https://forums.unrealengine.com/u/anonymous_user_e729f54e)\
**Post date:** [July 20, 2015, 3:04pm UTC](https://forums.unrealengine.com/t/android-mobile-event-end-play-problem/322076/16 "2015-07-20T15:04:11Z")

</div>

Hello pandagraphy,

You will need to add the component to the blueprint that you are showing above. You will then need to get a reference to that component and use it to set up the event. After this you will remove your End play event and instead hook up the new ApplicationWillEnterBackgroundDelegate Event.

 ![50784-appwillenterbgeventhelp.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/6/9/969f90655b3be14cd59ffdf64da9fb0e277b4c07.png)
