gideros / gideros

Gideros Release version
573 stars 112 forks source link

Android Landscape app rotates back to portrait after device power button is pressed... #238

Closed FuzzyDweeb closed 8 years ago

FuzzyDweeb commented 8 years ago

This bug is back again in Gideros 2016.06...

photo on 06-07-2016 at 8 15 am

FuzzyDweeb commented 8 years ago

Device = Samsung Galaxy S7

FuzzyDweeb commented 8 years ago

Previous closed thread relating to this bug...

https://github.com/gideros/gideros/issues/226

ar2rsawseen commented 8 years ago

As far as I see, bug fix is still there: https://github.com/gideros/gideros/blob/master/android/GiderosAndroidPlayer/src/com/giderosmobile/android/player/GiderosApplication.java#L1062-L1082

Maybe it is a build problem, can you try using gideros.jar from previous version which worked?

ar2rsawseen commented 8 years ago

Just to confirm if it is the same or something new :)

FuzzyDweeb commented 8 years ago

OK will try that shortly and report back here.

Of note the problem only occurs it seems if you let the app/screen time out to black screen and then attempt to play the app again from that point onwards.

FuzzyDweeb commented 8 years ago

I get 5 build errors if I try to build against an older known working gideros.jar in this Android Studio project.

I have several apps that were built with that jar tho on store that all work fine and don't produce this bug.

I use sensor landscape in my manifest but it does it with or without that.

I use Chartboost and AppLovin too but it still does it with or without those onboard.

I will try some more tests to see if I can find out anything else on Galaxy S7.

FuzzyDweeb commented 8 years ago

Works fine with vanilla Bird Animation exported with 2016.06 and built with latest Android Studio...very odd then - must be something else :P

photo on 06-07-2016 at 9 01 am 2

FuzzyDweeb commented 8 years ago

Hmmm after running a load of other difference tests I seem to have found that the problem does not manifest itself if I turn off stretch mode and use top left corner instead.

I then allowed the screen to time out again and then the bug came back.

So that is not it either :)

FuzzyDweeb commented 8 years ago

Going back to my original code (a landscape app)...

If I allow the screen to time out black and then attempt to play the app by pressing the home button while the device is still in landscape mode it all works fine.

If I allow the screen to time out black and then attempt to play the app by pressing the home button while the device is now rotated to portrait mode the bug manifests itself.

FuzzyDweeb commented 8 years ago

[Update:]

Following a load of tests this morning it appears that if you use the gideros ad wrapper in landscape mode (example AppLovin or Charboost) the bug occurs.

If you insert application:setKeepAwake(true) into your code the bug does not manifest itself.

If you do not use ads you won't see this bug.

Conclusion is bug is in or related ad wrapper after an add is displayed.

FuzzyDweeb commented 8 years ago

[Further update:]

You can of course recreate this bug by pressing the power button or waiting for the screen to time out to black and then attempting to continue play on Galaxy S7. The bug always presents when you do either of the above. You do not need to rotate the device as first thought either.

On further testing this morning on other devices I could not replicate the bug and it only appears to present itself on Samsung Galaxy S7 for me at least.

Maybe it's a firmware thing one the S7? I don't have much free time at the moment so will have to leave it there for now.

Not a massive problem if it is just one device of course.

FuzzyDweeb commented 8 years ago

and...

This is the only thing that prevents the bug happening at all under any timeout or button conditions on S7 for me...

application:setKeepAwake(true)

FuzzyDweeb commented 8 years ago

Solved... I was using an old lib template on several older apps that caused this issue it seems DOH!. Since it was fixed in the newer Gideros releases a while back cannot replicate further on Galaxy S7.