Hello everyone !
I'm experiencing some issue with a game I'm working on.
I'm using a SurfaceView linked with a thread to draw on it but when using a
thread as follows, my view onTouchEvent method never gets called.
> public void run()
>
> {
>
> Canvas c;
>
> while(_run)
>
> {
>
> c = null;
>
> c = _surfaceHolder.lockCanvas();
>
> if(c != null)
>
> {
>
> _view.onDraw(c);
>
> _surfaceHolder.unlockCanvasAndPost(c);
>
> }
>
> }
>
> }
>
I've no idea how to fix that anyway…
I've tried not using a thread and using a View instead but then I couldn't
find something convenient to refresh regularly my canvas.
Calling invalidate() in onTouchEvent() does not render very well (remember
that I'm working on a game so…) and using postDelayed worked but then
onTouchEvent seem to be called only once.
Hope you can help me.
Thanks a lot !
--
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