Issue
I am getting the phone contacts and problems are given but when I am using the async task the application stops working.
This is my error:
java.lang.IllegalArgumentException: Can't have a viewTypeCount < 1
I am calling the async task in the onCreate method like so:
new displayContacts().execute();
What am I doing wrong?
Solution
I guess getViewTypeCount returns the number of different types of views this adapter can return. type of view should just return 1.
public int getItemViewType(int position) {
return 0;
}
public int getViewTypeCount() {
return 1;
}
Answered By - Tung Tran
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.