Answer the question
In order to leave comments, you need to log in
Error: no suitable method found for setAdapter?
Good evening, when compiling the application, errors fly out, what am I doing wrong?
java:1226: error: no suitable method found for setAdapter(Object)
listView.setAdapter(reactorsAdapter);
^
method AdapterView.setAdapter(ListAdapter) is not applicable
(argument mismatch; Object cannot be converted to ListAdapter)
method AbsListView.setAdapter(ListAdapter) is not applicable
(argument mismatch; Object cannot be converted to ListAdapter)
method ListView.setAdapter(ListAdapter) is not applicable
(argument mismatch; Object cannot be converted to ListAdapter)
com\procrea8\mabtribune\modules\feed\adapter\FeedAdapter.java:1232: error: cannot find symbol
reactorsAdapter.addAll(((ReactResponse) response.body()).getMembers());
public void showReactorsDialog(int i) {
FeedResponse feedResponse = (FeedResponse) this.feedLists.get(i);
Builder builder = new Builder(this.context);
View inflate = this.layoutInflater.inflate(R.layout.reactors_dialog, null);
builder.setView(inflate);
builder.setTitle((CharSequence) "People who react to this");
ListView listView = (ListView) inflate.findViewById(R.id.reactorLists);
final Object reactorsAdapter = new ReactorsAdapter(this.context, new ArrayList());
226 строчка >>>> listView.setAdapter(reactorsAdapter);
((LikeApiInterface) Api.getRetrofit().create(LikeApiInterface.class)).getReacts("feed", feedResponse.getFeedId(), "50").enqueue(new Callback<ReactResponse>() {
public void onFailure(Call<ReactResponse> call, Throwable th) {
}
public void onResponse(Call<ReactResponse> call, retrofit2.Response<ReactResponse> response) {
reactorsAdapter.addAll(((ReactResponse) response.body()).getMembers());
}
});
builder.create().show();
}
Answer the question
In order to leave comments, you need to log in
final Object reactorsAdapter = new ReactorsAdapter
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question