Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot resolve method setListAdapter #62

Open
Melsara opened this issue Jul 12, 2018 · 3 comments
Open

Cannot resolve method setListAdapter #62

Melsara opened this issue Jul 12, 2018 · 3 comments

Comments

@Melsara
Copy link

Melsara commented Jul 12, 2018

I was trying to implement the adapter, but Android Studio does not recognize the method setListAdapter.
Error thrown is:
Cannot resolve method setListAdapter(com.wdullaer.swipeactionadapter.SwipeActionAdapter)
Import in the class is the following:

import com.wdullaer.swipeactionadapter.SwipeActionAdapter;
import com.wdullaer.swipeactionadapter.SwipeDirection;

Gradle dependencies as below:

dependencies {
   ...
    implementation 'com.wdullaer:swipeactionadapter:2.0.0'
}

I tried also to add the lib as external .jar file but same result.
Is there any compatibility issue with SDKs or gradle versions?

@Melsara
Copy link
Author

Melsara commented Jul 13, 2018

I found out that the problem is I am using a CursorAdapter. Do you have any hint on how to wrap the CursorAdapter with the SwipeActionAdapter?

Thanks,
Sara

@wdullaer
Copy link
Owner

You wrap your adapter with the SwipeActionAdapter by passing it into the constructor.

You then set the resulting SwipeActionAdapter to your ListView using its setAdapter() method.
In the example app, we're using a ListActivity, which has an embedded ListView. Essentially setListAdapter() passes through to setAdapter() on the ListView

I would also recommend using the latest version of this library.

@Melsara
Copy link
Author

Melsara commented Jul 13, 2018

Thank you for your reply.
I am still having the same problem also with setAdapter(), meaning
Cannot resolve method setAdapter(com.wdullaer.swipeactionadapter.SwipeActionAdapter)
So I am not sure if you have any idea about what could be the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants