私はArrayAdapter
満たされてArrayList
います。その項目のいずれかをクリックするたびに、 に再入力してArrayList
に送信notifyOnDataSetChange()
しadapter
ます。しかし、理由は不明ですが、項目を設定する方法ではArrayList
範囲外になります。getView()
なぜこれが起こるのかわかりません。呼び出しの理論を説明していただけないでしょgetView()
うか。なぜこれが起こっているのか理解できます。前もって感謝します!
ここにあります:
class MAdapter extends ArrayAdapter<String> {
public MAdapter(Context context, int textViewResourceId, List<String> objects) {
super(context, textViewResourceId, objects);
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View v = convertView;
if (v == null) {
LayoutInflater vi = (LayoutInflater) getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
v = vi.inflate(R.layout.file_explorer_row, null);
} else {
}
String txt = itemsList.get(position); // Out of bounds happens here
if (!txt.equals("")) {
TextView tt = (TextView) v.findViewById(R.id.file_explorer_tv_filename);
tt.setText(txt);
}
return v;
}
itemsList
Outer Class で宣言されています。