1

I have an app which has an activity A, that lets the user click on a thumbnail and go to another activity B which shows the thumbnail full screen. On activity B, if the user clicks anywhere on the screen, it closes the activity.

Both activities are defined as portrait in the manifest, and both have the onConfigChange value to contain the orientation flag.

It works perfectly on all versions of Android and all devices that I've tested, except one - Motorola Xoom, with Android 3.1. On the Xoom, if the user navigates quickly between the activities (back and forth), it has a chance to show activity A in landscape mode for a very short time, as if it planned to switch to it.

Not only that, but if it remove the flag of the onConfigChange in the manifest, activity A might re-create itself from scratch on this special case.

What could cause this weird thing? Is it some weird bug on android 3.1 or the Xoom? Is there anyway i can fix this issue? I could have something that blocks the touch on activity B for a few ms on the beginning, but that's just a workaround.

halfer
  • 19,824
  • 17
  • 99
  • 186
android developer
  • 114,585
  • 152
  • 739
  • 1,270
  • Hi, did you find a solution to the problem? – luben Sep 10 '12 at 12:24
  • Yes, I have the same problem on motorola xoom, android 3.2. Temporary fix for me will be to make empty activities extending the portrait ones and each activity to have fixed orientation in the manifest. But I wish I could find a better solution... – luben Sep 11 '12 at 08:52
  • i don't understand your solution . also , is your bug exist only when going fast between activities like on my case ? – android developer Sep 11 '12 at 11:30
  • My solution is to have one activity for portrait - e.g. MyActivity and one MyActivityLandscape extends Portrait. Then in the manifest have the first one with screenOrientation="portrait" and the second one screenOrientation="landscape" – luben Sep 11 '12 at 11:43
  • still don't understand . anyway , i think the best solution would be to use fragments instead of activities , though this is not always possible (for example if you use camera preview which for some reason must be in landscape or you get very weird issues) . – android developer Sep 11 '12 at 15:44
  • @Lyuben : could you please post your manifest – android developer Sep 19 '12 at 11:51

0 Answers0