[英]How to read ArrayList<String> from a specific row
I am trying to read a specific row and column from an ArrayList<String>
to display it in a textview.我正在尝试从ArrayList<String>
读取特定的行和列以在文本视图中显示它。
In a previous activity I read a Firebase table and stored all information selected by the user in an ArrayList<String>
.在之前的活动中,我读取了 Firebase 表并将用户选择的所有信息存储在ArrayList<String>
。 I do a putExtra
, and I recover all data by a Bundle
.我做了一个putExtra
,我通过一个Bundle
恢复了所有数据。 The ArrayList<String>
recovered seems correct. ArrayList<String>
恢复似乎是正确的。 But now I don't know what to do to read this ArrayList
.但现在我不知道如何读取这个ArrayList
。
I've looked at different solutions in Stack Overflow and Github without success.我在 Stack Overflow 和 Github 中查看了不同的解决方案,但没有成功。
Have you any idea?你有什么想法吗?
From your picture, it seems you don't have an ArrayList<String>
but rather a ArrayList<ArrayList<String>>
从您的图片来看,您似乎没有ArrayList<String>
而是ArrayList<ArrayList<String>>
To access it, use .get(index)
要访问它,请使用.get(index)
ArrayList<ArrayList<String>> ContenuAnnonceA;
int i=1, j=2;
String s = ContenuAnnonceA.get(i).get(j);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.