@Override protected void onCreate(Bundle icicle) { super.onCreate(icicle); DisplayMetrics metrics = new DisplayMetrics(); getWindowManager().getDefaultDisplay().getMetrics(metrics); XoLib.initXo(getCacheDir().getAbsolutePath(), metrics.scaledDensity); mView = new XoView(getApplication(), metrics.scaledDensity); setContentView(mView); }
@Override public boolean onTouchEvent(MotionEvent event) { // Log.w( "a", "touch me " + Float.toString( event.getX() ) + ", " + Float.toString( // event.getY() ) ); float[] x = new float[event.getPointerCount()]; float[] y = new float[event.getPointerCount()]; for (int i = 0; i < event.getPointerCount(); i++) { x[i] = event.getX(i); y[i] = event.getY(i); } XoLib.input(1, x, y); mView.requestRender(); return true; }
@Override protected void onDestroy() { super.onDestroy(); XoLib.destroy(); }