简体   繁体   English

如何读取ArrayList<String> 从特定行

[英]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?你有什么想法吗?

在此处输入图片说明

Result of ArrayList ArrayList 的结果

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.

相关问题 如何添加从文件读取的字符串到ArrayList? - how to add string read from file to an ArrayList? 如何比较ArrayList中的元素和特定的String? - How to compare an element from ArrayList with a specific String? 如何删除 arraylist 中的特定行 - How to remove a specific row in arraylist 如何使用循环从特定的ArrayList行获取数据? - How to get data from a specific ArrayList row using with a loop? Java,从字符串读入ArrayList - Java, read from a String into an ArrayList 如何从ArrayList获取所有行 <ArrayList<String> &gt;在特定列中具有特定值? - How to get all rows from ArrayList<ArrayList<String>> having specific value in specific column? 如何从文件读取一个ArrayList到另一个ArrayList? - How to read an ArrayList from a File into another ArrayList? 用另一个ArrayList中的随机字符串替换ArrayList中的特定字符串 - Replace specific string in ArrayList with random string from another ArrayList JAVA-如何读取特定行然后将其放入arraylist - JAVA - how to read specific line then put it in arraylist 如何在没有参数的情况下对特定行的 ArrayList 进行排序,以区分该特定元素中的第一个条目和第二个条目? - How to sort an ArrayList for a specific row without a parameter to differentiate from first to second entry in that specific element?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM