I have a list view with an image icon on the left and three text views on the right in a single row. I have created the layout, but while creating the adapter class I am facing some issues. Here is the code:
import android.app.Activity;
import android.widget.ArrayAdapter;
public class CustomList extends ArrayAdapter<String>{
private final Activity context;
private final String[][] listRow;
private final Integer[] imageId;
public CustomList(Activity context, String[][] listRow, Integer[] imageId){
super(context, R.layout.rowlayout, listRow);
}
}
First I created three 1D arrays for the three textviews, but in the constructor I was not able to pass them all.
So I had to create a 2D array where every row in the table would represent information about a single list view item.
But I am not able to do so. I get an error:
Cannot resolve method
super(android.app.Activity, int, java.lang.String[][])with 2D arrays
How do I solve this issue?
ArrayAdapter<String[]>so that your listRow matches the type of the third parameter of the super class constructor?