Note that there are some explanatory texts on larger screens.

plurals
  1. POsetonclicklistener and setontouchlistener at one time in android
    primarykey
    data
    text
    <p>i am new to android and having a requirement that setonclicklistener and setonTouchlistener both work at one time.i m performing some operation on the adapter side where i m having the imageview.some code to understand </p> <p>adapter class:</p> <pre><code>public class Taukygridview extends BaseAdapter{ holder.imageview.setOnClickListener(new OnClickListener() { //some click operation here }); holder.imageview.setonTouchListener(new MyTouchListener()); holder.imageview.setonTouchListener(new MyDragListener()); } </code></pre> <p>here is the MyTouchListener class description:</p> <pre><code>public class MyTouchListener implements OnTouchListener { private Context mcontext; public static int view_position=0; public static View first_image_view; @Override public boolean onTouch(View v, MotionEvent event) { // TODO Auto-generated method stub //some touch operation here } } </code></pre> <p>here is some description on the drag operation..</p> <pre><code>public class MyDragListener implements OnDragListener { @Override public boolean onDrag(View v, DragEvent event) { // TODO Auto-generated method stub switch(v.getId): { //some drag operation here } } </code></pre> <p>so while running the app only the touch operation work and if the touch operation return false then only the click operation work but can't omit or comprise any of the operation(actually i m performing click for selection and touch for the drag and drop operation).so can any one suggest me how can do all the operation without disabling any of the operation mention above.any reply will be very helpfull.thanks</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload