i'm trying to add the touch events X & Y axis to arraylist. But it shows me 
empty in logcat ("X:[] Y:[] ")
where am i making mistake?? help me please!!!

*@Override*
* public boolean onTouch(View bg, MotionEvent event) {*
* // TODO Auto-generated method stub*
* dumpEvent(event);*
* ArrayList<String> xaxis = new ArrayList<String>();*
* ArrayList<String> yaxis = new ArrayList<String>();*
* *
* StringBuilder xsb = new StringBuilder ();*
* StringBuilder ysb = new StringBuilder ();*
* xaxis.clear();*
* yaxis.clear();*
* *
* int action = event.getAction();*
* switch (action) {*
* case MotionEvent.ACTION_DOWN:*
* ///some code*
* break;*
*
*
* case MotionEvent.ACTION_MOVE:*
* //drawCircle(event);*
* for (int i = 0; i < event.getPointerCount(); i++) {*
* xsb.append((int) event.getX(i));*
* ysb.append((int) event.getY(i));*
* }*
* xaxis.add(xsb.toString());*
* yaxis.add(ysb.toString());*
*// Log.d("X :", xsb.toString());*
*// Log.d("Y: ", ysb.toString());*
* Collections.sort(xaxis);*
* Collections.sort(yaxis);*
* *
* Log.d(TAG, "DRAG");*
* break;*
*
*
* case MotionEvent.ACTION_UP:*
* Log.d("X:", xaxis.toString());*
* Log.d("Y:", yaxis.toString());*
* mode = NONE;*
* Log.d(TAG, "mode=NONE");*
* break;*

-- 
-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to