android swipe on ListView doesn't get the correct row

I am using the following(Android Swipe on List) code to detect swipe on listview, and I am using a CustomCursorAdapter to populate the listview from a cursor. however, when I print the value of the row view swiped, it gives me random values from the list and not the swiped row. the swipe detecetor is exactly as in the other question and the customCusrsorAdapter looks like this:

class customCursorAdapter extends SimpleCursorAdapter {
public void bindView(View view, final Context context, Cursor cursor) {
final SwipeDetector swipeDetector = new SwipeDetector();
v = (LinearLayout)view.findViewById(;

This detects the MotionEvent.ACTION_DOWN but doesn't get the swipes to left and right. any ideas ?


Need Your Help

How to install Google Play Services in a Genymotion VM (with no drag and drop support)?

android genymotion

How can I install Google Play Services in a Genymotion emulator with no drag and drop support?

Can NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES) return multiple entries?

ios cocoa

A commonly used method to find the location of the locally writable Library directory on iOS is NSSearchPathForDirectoriesInDomains, like so:

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.