0

I created an app which works fine on emulators but sometimes, when switching from an activity to another on a real device (Samsung Note 2), i get a black screen and then after one second, I am forwarded to my previous activity.

Anyone had the same issue ? or a solution ?

For example (letters are activities) I go to A -> B -> C -> D then go back to A ->B and then black screen to access to C and goes back to B.

My activities are simple ones which are simply forms. At first, i thought it was because I had several asynctasks to reach the internet (submit forms, login, download or upload pictures) but I always add:

     response.getEntity().consumeContent(); just after the get the response

and

    mtask.cancel(); (après isCancelled) in the post execution section

After, I thought it was because i have a lot of: putExtraString but I checked that it was not enough data to cause any issues.

My guess is maybe because I setbackground after oncreate through my app which may generate some workload. But it didn't.

I switched my launch mode parameters to cleartaskatlaunch and it is slightly better but I still get the black screen pretty often.

5am here... going to bed hoping i will find an answer tomorrow.

Thank you

Laurent

  • I've no answer but this approach might help you. If it's fine on the emulator and not on the real device I'd first assume It's not the Android OS. Then if they are the same OS versions then I'd assume it's not the OS version. If the OS versions are different I'd create a new AVD with the device's OS and see if the same happens on the emulator. Else I'd try it on different devices and see if it's common across all devices. If common I'd search across the internet for similar cases. Else I try to narrow down the differences of the properly working devices and not properly working devices. – JanithaR Feb 21 '13 at 04:34
  • Thanks a lot! Found the issue, it was my setbackground function which trigered a memory error... I put all my images in the xhdpi folder and the problem disappeared. Thanks again. – Laurent Milleron Feb 23 '13 at 01:39

0 Answers0