我想將我的數組列表轉換爲字符串一段時間,並將字符串轉換爲數組列表,因爲我想將字符串插入到列表視圖中並且此字符串包含一些隨機/ N,這裏是代碼:如何將數組列表<object>轉換爲字符串並將其重新轉換爲數組列表<object>
ArrayList<msg> per = new ArrayList<msg>();
String t;
t="................................./n........";
msm = new msg();
test();
per.add(msm);
MonAdapter adapter = new MonAdapter(this, R.layout.list, per);
你想把字符串分成許多基於分隔符的子串/ n –
不要。你想要的是按照原樣顯示對象,這意味着必須增強適配器才能正確顯示它們。例如,像https://guides.codepath.com/android/using-the-recyclerview中的自定義佈局。 – zapl
@haceneabdessamed yes yes –