Tag Archives: surfaceview

7,201 views

View overrides onTouchEvent but not performClick

public class Panel extends SurfaceView implements SurfaceHolder.Callback { //…………… code //…………… some code /** * Process the MotionEvent. */ @Override public boolean onTouchEvent(MotionEvent event) {   synchronized (getHolder()) { if (event.getAction() == MotionEvent.ACTION_DOWN) { performClick(); } else if (event.getAction() == … Continue reading

Posted in Android Examples Code, Bugs, warnings, errors | Tagged , , , | Comments Off on View overrides onTouchEvent but not performClick
7,830 views

SurfaceView implements Runnable Android Code

package cz.okhelp.surfview;   import android.os.Bundle; import android.app.Activity; import android.content.Context; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Canvas; import android.view.Menu; import android.view.MotionEvent; import android.view.SurfaceHolder; import android.view.SurfaceView; import android.view.View; import android.view.View.OnTouchListener;   public class MainActivity extends Activity implements OnTouchListener { OurView v; Bitmap ball, … Continue reading

Posted in Android Examples Code, Bitmap, drawing | Tagged , | Comments Off on SurfaceView implements Runnable Android Code