ICS auto rotation off causes force

  ... in the unlikely case you discovered a bug, post it here.

ICS auto rotation off causes force

Postby tmcthree » Thu Jul 26, 2012 4:47 am

I've just upgraded to ice cream sandwich on my xperia s.

Now, if auto screen rotation is "off".

When my game starts a new activity, the "recent apps" list briefly flashes on screen just before the new activity starts.

More seriously, in order to stop a looped sound, I override "onPause" and call the method "sound.stop". This causes a force close.

if auto screen rotation is "on", or I run on gingerbread. Everything works normally.

This is the particular piece of code that's causing the fc

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.         @Override
  2.         public void onPause() {
  3.                 super.onPause();
  4.                 mCrowd02Sound.stop();
  5.         }
  6.  
Parsed in 0.012 seconds, using GeSHi 1.0.8.4


and the logcat

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. 07-21 13:04:30.884: W/dalvikvm(27646): threadid=1: thread exiting with uncaught exception (group=0x40ab2210)
  2. 07-21 13:04:30.894: E/AndroidRuntime(27646): FATAL EXCEPTION: main
  3. 07-21 13:04:30.894: E/AndroidRuntime(27646): java.lang.RuntimeException: Unable to pause activity {com.webs.thefineanimationemporium/com.webs.thefineanimationemporium.Level1Activity}: java.lang.NullPointerException
  4. 07-21 13:04:30.894: E/AndroidRuntime(27646):    at android.app.ActivityThread.performPauseActivity(ActivityThread.java:2726)
  5. 07-21 13:04:30.894: E/AndroidRuntime(27646):    at android.app.ActivityThread.performPauseActivity(ActivityThread.java:2682)
  6. 07-21 13:04:30.894: E/AndroidRuntime(27646):    at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:3340)
  7. 07-21 13:04:30.894: E/AndroidRuntime(27646):    at android.app.ActivityThread.access$700(ActivityThread.java:127)
  8. 07-21 13:04:30.894: E/AndroidRuntime(27646):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1162)
  9. 07-21 13:04:30.894: E/AndroidRuntime(27646):    at android.os.Handler.dispatchMessage(Handler.java:99)
  10. 07-21 13:04:30.894: E/AndroidRuntime(27646):    at android.os.Looper.loop(Looper.java:137)
  11. 07-21 13:04:30.894: E/AndroidRuntime(27646):    at android.app.ActivityThread.main(ActivityThread.java:4441)
  12. 07-21 13:04:30.894: E/AndroidRuntime(27646):    at java.lang.reflect.Method.invokeNative(Native Method)
  13. 07-21 13:04:30.894: E/AndroidRuntime(27646):    at java.lang.reflect.Method.invoke(Method.java:511)
  14. 07-21 13:04:30.894: E/AndroidRuntime(27646):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:823)
  15. 07-21 13:04:30.894: E/AndroidRuntime(27646):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:590)
  16. 07-21 13:04:30.894: E/AndroidRuntime(27646):    at dalvik.system.NativeStart.main(Native Method)
  17. 07-21 13:04:30.894: E/AndroidRuntime(27646): Caused by: java.lang.NullPointerException
  18. 07-21 13:04:30.894: E/AndroidRuntime(27646):    at com.webs.thefineanimationemporium.Level1Activity.onPause(Level1Activity.java:650)
  19. 07-21 13:04:30.894: E/AndroidRuntime(27646):    at android.app.Activity.performPause(Activity.java:4563)
  20. 07-21 13:04:30.894: E/AndroidRuntime(27646):    at android.app.Instrumentation.callActivityOnPause(Instrumentation.java:1195)
  21. 07-21 13:04:30.894: E/AndroidRuntime(27646):    at android.app.ActivityThread.performPauseActivity(ActivityThread.java:2713)
  22. 07-21 13:04:30.894: E/AndroidRuntime(27646):    ... 12 more
  23.  
  24.  
  25.  
Parsed in 0.013 seconds, using GeSHi 1.0.8.4
tmcthree
 
Posts: 337
Joined: Mon Aug 08, 2011 8:21 pm

Re: ICS auto rotation off causes force

Postby OzLark » Thu Jul 26, 2012 5:39 am

Sorry, very busy to look at this properly - but is your issue related to this: gles2/black-screen-after-facebook-auth-dialog-t8532.html#p37182
Did this post help you? Feel free to return the gesture by downloading Ninja Bees, creating a level (or more) and sharing it to the Ninja Bees website!

Ninja Bees - Our latest Android game, check it out on Google Play (free) or paid with no ads
OzLark
 
Posts: 1130
Joined: Sun Feb 05, 2012 3:19 am

Re: ICS auto rotation off causes force

Postby tmcthree » Thu Jul 26, 2012 5:09 pm

thankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyou etc.

OzLark you're a lifesaver

This works

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.         @Override
  2.         public void onPause() {
  3.  
  4.                 super.onPause();
  5.                 if (this.mCrowd02Sound != null) {
  6.                         this.mCrowd02Sound.stop();
  7.                 }
  8.  
  9.                 //
  10.         }
  11.  
Parsed in 0.010 seconds, using GeSHi 1.0.8.4
tmcthree
 
Posts: 337
Joined: Mon Aug 08, 2011 8:21 pm

Re: ICS auto rotation off causes force

Postby OzLark » Fri Jul 27, 2012 2:12 am

:)
Did this post help you? Feel free to return the gesture by downloading Ninja Bees, creating a level (or more) and sharing it to the Ninja Bees website!

Ninja Bees - Our latest Android game, check it out on Google Play (free) or paid with no ads
OzLark
 
Posts: 1130
Joined: Sun Feb 05, 2012 3:19 am

Re: ICS auto rotation off causes force

Postby tmcthree » Fri Jul 27, 2012 2:30 am

although..... :cry:

a slight disappointment that this code doesn't seem to resume the sound...

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.         @Override
  2.         public void onResume() {
  3.  
  4.                 super.onResume();
  5.                 if (this.mCrowd02Sound != null) {
  6.                          this.mCrowd02Sound.play();
  7.                 }
  8.  
  9.                 //
  10.         }
  11.  
Parsed in 0.010 seconds, using GeSHi 1.0.8.4


but to be honest, I can live with this if I have to. It's not fatal.. :|
tmcthree
 
Posts: 337
Joined: Mon Aug 08, 2011 8:21 pm

Re: ICS auto rotation off causes force

Postby thepi » Sat Sep 29, 2012 2:21 am

What if you use .pause() instead of .stop() ?
Go and trap them... Trap Balls on Google Play
Play & reminisce... Treasure Island LCD Retro
thepi
 
Posts: 456
Joined: Sun Oct 09, 2011 9:30 pm


Return to Bugs

Who is online

Users browsing this forum: No registered users and 4 guests