Problem with returning from sleep mode.

Put your problem here if it does not fit any of the other categories.

Problem with returning from sleep mode.

Postby tsl » Sat May 16, 2009 1:30 am

Returning from sleep causes game to run, but the screen doesn't update (on real (G1) device, but works fine on emulator)

I'm using DView class that extends SurfaceView and implements SurfaceHolder.Callback, with constructor that contains :
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. SurfaceHolder surfaceHolder = getHolder();
  2.  
  3. surfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_HARDWARE);
  4.  
  5. surfaceHolder.addCallback(this);
  6.  
  7.  
Parsed in 0.030 seconds, using GeSHi 1.0.8.4

Dview of course overrides each of the SurfaceHolder.Callback methods .
Rendering is performed in other thread:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2. SurfaceHolder surfaceHolder = dview.getHolder();
  3.  
  4. Canvas c = surfaceHolder.lockCanvas(null);
  5.  
  6. try
  7.  
  8. {
  9.  
  10.         c.drawBitmap(backbuffer.bitmap, 0, 0, null);
  11.  
  12.        System.out.println("frame "+frm);
  13.  
  14. }
  15.  
  16. finally
  17.  
  18. {
  19.  
  20.         surfaceHolder.unlockCanvasAndPost(c);
  21.  
  22. }
Parsed in 0.031 seconds, using GeSHi 1.0.8.4


Everything works perfectly on android emu, but there's huge problem on real device.
I'm rendering some anims to the backbuffer. When returning form sleep mode screen is not updated. All i can see are two (switching) anim frames.. the ones rendered _before_ device (G1) enetred sleep mode.
There are no null pointers. All objects are valid.
App outputs to log increasing frame numbers (prntln).
Even if i draw directly on canvas (instead drawing backbuffer) - there's no visible change on screen.


Any idea what's wrong ?

P.S.

The only difference between emu and G1 system logs is this (on real device):

W/InputManagerService( 55): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@4339ed48
tsl
Once Poster
Once Poster
 
Posts: 1
Joined: Wed May 13, 2009 12:33 am

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 14 guests