0

I've a problem with my app, when I press side standby(screen disable) button when app is opened and turn on screen again and unlock my app is now in background, also, when I reopen it from background it restarts with loading screen(so it loose my previous app state and reset it). But when I place my app in background going to home and reopen it, it start from where it was when it goes in background. Same if I close screen when app is already in background.

How can I solve this problem?

Hussein El Feky
  • 6,627
  • 5
  • 44
  • 57
Singee
  • 523
  • 2
  • 6
  • 16
  • check this http://stackoverflow.com/questions/151777/saving-activity-state-on-android?rq=1 , it might help you. – Jaeger Jan 30 '16 at 16:37

1 Answers1

0

Android usually keeps your app on the foreground even if you press on the power button (side standby). Try using the SavedInstance as mentioned by Abo Hani.

Otherwise, Try testing the app on other devices with different android versions.

Android only sends apps to the background if it needs more resources(memory,network,etc) to process other apps. Sometimes it might also kill the app.