2

I'm having an issue with my app on a Kindle Fire.

I don't have a device of my own, but the app reviewers (and a friend of mine who tested it for me) are having an issue with the app closing, with no error message after coming out of hibernation.

The exact issue is that if you hibernate in portrait, and then come out of hibernation after moving the device in to landscape mode, it simply just displays the home screen. No force close or anything.

The funny thing is that if you're at another activity in the app (it's only got 2 screens) it works just fine. The main menu activity is the one that this happens on. I've checked the onResume for both activities and they're the same. The main menu screen is a ListActivity, though. Could this be part of the issue?

When resuming after changing the orientation, is OnCreate called again?

I'm hoping someone can point me in the right direction because my only method of testing is re-submitting and sending an APK to a friend overseas.

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
Rev Tyler
  • 601
  • 7
  • 17
  • It's _really_ hard to correct issues that you can't reproduce. You're going to need a stack trace to figure this out. You can talk your friend (or a customer) through capturing the log, or try to repro it with the Kindle emulator. https://developer.amazon.com/sdk/fire/emulator-guide.html – Krylez Jun 15 '13 at 03:03
  • They sent me the logs, but I couldn't find anything helpful. http://pastebin.com/GB4FNiZG The package name for my app is com.selfstudyapps.photo.guide That should help find the last entry related to it. It gets a pause and then nothing. No sign of it trying to come back and failing. – Rev Tyler Jun 15 '13 at 03:24

2 Answers2

0

I have a similar problem, some complex Kindle with hibernate and change orientation. The frustrating thing is I cannot even get a Kindle fire since they do not ship to my country.

The one point I can answer for you is "When resuming after changing the orientation, is OnCreate called again?" My understanding of the below guide is that onCreate is not called but you must use on resume, and on pause.

"Your app must account for hibernation on Kindle Fire—whether the hibernation is user initiated or occurs after the screen times out. Similar to the Quick Settings optimization, hibernation optimization requires a proper handling of the onPause() and onResume() methods."

from https://developer.amazon.com/post/Tx385PNGJFMEB4R/Managing-Hibernation-Top-10-App-Optimizations-for-Kindle-Fire.html

I really Struggle with the Kindle Emulator and most times cannot start it up.

Ryan Heitner
  • 13,119
  • 6
  • 77
  • 119
0

I too come across the same problem. This is because on Kindle fire, if user hibernate, change the orientation and come out of hibernate, onConfigurationChanged() method is being called before onResume().

This is a problem of fragmentation on Android by Amazon.

As a work around I declared two booleans isPaused and isActivityNeedReconstructionAfterConfigChange.

Code looks something like this: void onPause(){

isPaused = true;

} void onResume(){

if (isPaused && isActivityNeedReconstructionAfterConfigChange){

//do what you do in onConfigurationChanged()
}
isPaused = false;

}

void onConfigurationChanged(){

isActivityNeedReconstructionAfterConfigChange = true;

if( ! isPaused){

   isActivityNeedReconstructionAfterConfigChange = false;

   //do what you do in onConfigurationChanged()

}

}