私は ArrayList のリストを作成する必要があります、私の考えはそれでした:
Map<Integer, ArrayList<String>> SentReportMap=new HashMap<Integer, ArrayList<String>>();
それは言う:
Use new SparseArray<ArrayList<String>>(...) instead for better performance
だから、私はこれを試します:
SparseArray<String> SentReportMap = new SparseArray<String>();
ArrayList<String> items=new ArrayList<String>();
items.add(array.getProperty("To").toString());
items.add(array.getProperty("Date").toString());
SentReportMap.put(1, items);
ただし、この配列にデータを入力するには、次のエラーを返します。
The method put(int, String) in the type SparseArray<String> is not applicable for the arguments (int, ArrayList<String>)
または
The method put(int, String) in the type SparseArray<String> is not applicable for the arguments (ArrayList<String>, int)
どこが間違っていて、配列の配列リストを作成するためのより良い解決策は何ですか!?