Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
Locked
0

Android kills my app when I deactivate it

Guest
Oct 26, 2011 Oct 26, 2011

Hello,

I have a problem when (for example) the user receives a call or he press the home button.

I have set the DEACTIVATE and the ACTIVATE handlers and when the user for some reason "iconizes" my app, I set the systemIdleMode back to NORMAL and I show the user a "welcome back" window when he switches again on my app.

The problem is that Android keeps killing my app (not always but often) quite instantly

When it does not, I see that the CPU is used at 0.98% and RAM is about 35 Mb so I do not think it's so consuming.

Do this happens also to you?

Any hint/suggestion?

Thanks in advance

TOPICS
Development
1.3K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Oct 26, 2011 Oct 26, 2011

I don't see this at all, but I tend to write only small test apps. I did see another report whcih made me wonder if Android 2.3.3 is more aggressive about shutting down background apps than previous versions.

Still, the possibility that the OS can shut down your app has to be taken into account. If the visible symptom in your app is that the "welcome back" message is displayed too frequently, perhaps you could save the time when your app deactivates and only show the welocome back message if an appropriate interval has elapsed.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Oct 26, 2011 Oct 26, 2011

HI Joe,

Thanks for your hitns, I think I've found the problem.

I try to explain it in my poor "engrish".

I think that the action of creating the "welcome back" screen is too cpu-consuming when the app is changing his state from "have focus" to "run in background mode" although I can't tell the cause (the "welcome back" screen is pretty simple, just one layer created to the top of the display list saying "game paused" with a button "Continue").

I solved the problem by not creating the "welcome back" screen when the deactivate event is triggered, but I create the "welcome back" screen when the activate event is triggered.

The user can't notice this change and the app is no longer killed by Android.

Thanks

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Dec 09, 2011 Dec 09, 2011

Once again, I'm here with the same problem.

As my app increases of complexity, I notice it is killed by Android a lot of time when I receive a call or when I simply hit "home" button.

Although the app is really complex (a lot of sections), I do not have big animations or cpu/gpu consuming operations.

I'm also pretty sure that I do not have enter frame running (for example I have a small clock that I deactivate when the deactivate event is triggered).

The only thing I can think of is the database connections, I have them always active and I do not kill and recreate it.

It can be this the problem?

Someone has any hint?

Thanks in advance

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Dec 09, 2011 Dec 09, 2011
LATEST

Your best bet is to recreate the crash while running adb logcat, it should tell you when and why it crashes/errors

also, i can't imaging you are still using this specific version of air, with GPU, in combination with a droidx or droid2 but just in case

https://bugbase.adobe.com/index.cfm?event=bug&id=2993046

although i mostly wrote about framerate in that bug report, it was also crashing much of the time when changing focus like you describe. It's fixed now so i assume this is not your problem.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines