0

以下のコードを参照してください。文字列のすべてのオブジェクトではなく、1 つのオブジェクトを配置する必要がある理由を知りたかったのです。このコードは、カスタム ListView アダプターからのものです。

public ArrayAdapter (コンテキスト コンテキスト、int textViewResourceId、T[] オブジェクト)

正常に動作

public ListViewAdapter(Context context, String[] first, String[] second, String[] third) {
            super(context, R.layout.listview_item, first);
            this.context = context;
            this.first = first;
            this.second = second;
            this.third = third;
        }

これを行うとエラーになります。

public ListViewAdapter(Context context, String[] first, String[] second, String[] third) {
        super(context, R.layout.listview_item, first, second, third);
        this.context = context;
        this.first = first;
        this.second = second;
        this.third = third;
    }

エラー : コンストラクター ArrayAdapter(Context, int, String[], String[], String[]) は定義されていません

元のソース

public class ListViewAdapter extends ArrayAdapter<String> {
    Context context;
    String[] first;
    String[] second;
    String[] third;
    LayoutInflater inflater;

    public ListViewAdapter(Context context, String[] first, String[] second, String[] third) {
        super(context, R.layout.listview_item, first);
        this.context = context;
        this.first = first;
        this.second = second;
        this.third = third;
    }
4

1 に答える 1