J
J
Janea Morari2018-02-14 19:21:25
Java
Janea Morari, 2018-02-14 19:21:25

How to create an array within an array and auto select?

Hello, I have one question. Please tell me, there is a listview in main, it is filled from the "people" array. There are elements in the people array: zhorik, gene, svetozar, etc.
Each hero has their own properties, such as age, gender, and so on, this data is stored in a different array, each person has his own array.
Now, when you click on one hero, another activity opens and the script should automatically select information from the array of the selected person. Help please, how to do it?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
T
Therapyx, 2018-02-14
@Therapyx

just create 1 class sheet "people". You display this sheet as a list, for example by name. On a click on it, the index of the sheet is selected or by the id in the attributes and all the necessary information is obtained, which is sent to the trace of the activity.

O
one pavel, 2018-02-14
@onepavel

when you click on the leaves, the id of the item is transferred inside the opening activity, this id is caught in the activity and data is selected in the second array, instead of the id of the item, you can transfer any data, but in general a sad situation

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question