简体   繁体   中英

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.

In a previous activity I read a Firebase table and stored all information selected by the user in an ArrayList<String> . I do a putExtra , and I recover all data by a Bundle . The ArrayList<String> recovered seems correct. But now I don't know what to do to read this ArrayList .

I've looked at different solutions in Stack Overflow and Github without success.

Have you any idea?

在此处输入图片说明

Result of ArrayList

From your picture, it seems you don't have an ArrayList<String> but rather a ArrayList<ArrayList<String>>

To access it, use .get(index)

ArrayList<ArrayList<String>> ContenuAnnonceA;
int i=1, j=2;
String s = ContenuAnnonceA.get(i).get(j);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM