Android Question converting list of map to list

toby

Well-Known Member
Licensed User
Longtime User
Let's say I have a long list of names and each name is a map (firstName, middleName, lastName). Now I want a list of firstName. I know how to build the list the hard way by going through each item. I'm wondering whether there is any trick, an easier way, to achieve that.
 

RB Smissaert

Well-Known Member
Licensed User
Longtime User
Let's say I have a long list of names and each name is a map (firstName, middleName, lastName). Now I want a list of firstName. I know how to build the list the hard way by going through each item. I'm wondering whether there is any trick, an easier way, to achieve that.

I don't think there is any other way then running a loop and add all the FirstNames to the new list.

RBS
 
Upvote 0

KMatle

Expert
Licensed User
Longtime User
Maybe you want to use a database (SQLite is a good choice). Lists/Maps are good for data-transportation or a small amout of entries. With a db you can retrieve the data very fast and only the data you need at that moment.
 
Upvote 0

toby

Well-Known Member
Licensed User
Longtime User
Maybe you want to use a database (SQLite is a good choice). Lists/Maps are good for data-transportation or a small amout of entries. With a db you can retrieve the data very fast and only the data you need at that moment.

I get data, a list of map, from remote mysql server using httpJob. I just wish that I could use local Sqlite instead.
 
Upvote 0
Top