Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Android / Android - detecting when the application is going in to the background.

Author
Message
erebusman
12
Years of Service
User Offline
Joined: 23rd Jul 2011
Location: Sacramento, CA
Posted: 18th Nov 2012 20:28
Hello,

Similar to this thread http://forum.thegamecreators.com/?m=forum_view&t=198533&b=44&p=0

I have an issue where I want to take certain actions when the application is going into the background.

Specifically I have found that AppGameKit does not turn off my music when my app is sent into the background ; so this is not good ; it makes for a very high irritation factor at least to me and the people who have tested my app so far.

I did some googling and found that Android handles this


From
http://developer.android.com/reference/android/app/Activity.html



onPause() is where you deal with the user leaving your activity. Most importantly, any changes made by the user should at this point be committed (usually to the ContentProvider holding the data).


This is exactly what I need - I just dont see how AppGameKit addresses this? Which I suspect it does not from the behavior I'm seeing.

Any android / agk geniuses out there know how to integrate this functionality into my app?

Thanks in advance for any help/tips!

PaulTR
11
Years of Service
User Offline
Joined: 25th Oct 2012
Location: Fresno, CA
Posted: 19th Nov 2012 02:09
AL had mentioned in a post to me that the home button comes through as raw key input number 27, or something along those lines. Write a basic program to test what the input is from the back button as well, and just have a statement in your loop where if raw input is either of those, pause the music?
erebusman
12
Years of Service
User Offline
Joined: 23rd Jul 2011
Location: Sacramento, CA
Posted: 19th Nov 2012 02:51
Not a bad idea I'll see if I can test that out , thanks for the suggestions.

erebusman
12
Years of Service
User Offline
Joined: 23rd Jul 2011
Location: Sacramento, CA
Posted: 21st Nov 2012 18:03
Unfortunately the proposed solution does not work well. As there are many different Android devices; for instance on my Kindle fire the home button is not a physical button and this doesn't work for it.

So we need a real AppGameKit function that knows when the app is going to the background.

Login to post a reply

Server time is: 2024-03-29 11:13:38
Your offset time is: 2024-03-29 11:13:38