loosing image handles on Android 4

Monkey Forums/Monkey Bug Reports/loosing image handles on Android 4

Midimaster(Posted 2013) [#1]
I have a app Score-Trainer for reading notes. The old version was made on V66 and Android SDK 13. The app has the #ANDROID_SCREEN_ORIENTATION="user" and the user can turn around the screen. The app never had problems with this feature.

Now I updated to Monkey V69 and Android SDK 17.

On a Android 2.3 I can turn around as often as I want, I get no problems.

On Android 4.x the app works perfect if you start in landscpe mode or portrait mode and do not turn around the tablet!

But when you turn around, the app seems to loos the images handeles and displays wrong images:



http://www.blitzforum.de/upload/file.php?id=12380

On Startup the app should display startscreen (image 5) and above the keys the logo midimaster (image 6). But what you see is image 1: a combination of the angelfont( image 3) and the logo. Or sometimes it shows a combination of the logo and the logo streched (image 2)

This al will result in a wrong handle to angelfont image. and so all texts are displayed with white rectangles (image 4)


marksibly(Posted 2013) [#2]
I haven't been able to reproduce this - I ran a few bananas with "user" orientation and they all worked fine.

Can you provide a simple, runnable example?


Midimaster(Posted 2013) [#3]
you need a android 4.xx device. And within these group of devices only 50% of my users have problems. It's a strange bug.

I sent you the link to the apk-file, which causes the problems, via email.

At the moment I'm in contact with my beta testers. We try to isolate the bug and reduce the code until we have a very slim demo version.


Xaron(Posted 2013) [#4]
I had this as well but not with orientation changes but after suspending the app and reentering it.


Midimaster(Posted 2013) [#5]
Ok... after testing the new way for a few days, I can say now it works stabil.

The reason for the bug was:

If you change targetSdkVersion="17" in the Manifest to say, that your code is tested on Android 4.2...

<uses-sdk android:minSdkVersion="3" android:targetSdkVersion="17" />


... you have also to define, that the handling of orientation changes will be made by the app with screenSize:

android:configChanges="keyboardHidden|orientation|screenSize"


Otherwise the smartphone restarts the app on every orientation change.

With this changes the error did not occure any longer.

I could not find out, why after those restarts the handles of the images got invalid. It seems, that the "restart" was not really a complete restart.