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 :
SurfaceHolder surfaceHolder = getHolder();
surfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_HARDWARE);
surfaceHolder.addCallback(this);
Dview of course overrides each of the SurfaceHolder.Callback methods .
Rendering is performed in other thread:
SurfaceHolder surfaceHolder = dview.getHolder();
Canvas c = surfaceHolder.lockCanvas(null);
try
{
c.drawBitmap(backbuffer.bitmap, 0, 0, null);
System.out.println("frame "+frm);
}
finally
{
surfaceHolder.unlockCanvasAndPost(c);
}
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
$pr...@4339ed48
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---