3
I have a query that returns a person’s name and surname. With the result of this query, I enter the information within a ListView
and displays the name and surname.
How do I display only the name?
And then I would have to use the string name using the arraAdapter.getItem(position);
but also take only the name, could not come the surname.
Note: Unfortunately I cannot change the query, it must return the name and the same surname, also can not use CursorAdapter
in query.
Post the code so the answers can be concise.
– Jean Carlos
A question. "Name" and "Last name" are separate columns of the table or you save the full name of the person in a "Full Name" column"?
– regmoraes
Name and Surname are separate columns.
– daniel12345smith
Without seeing the code and given the limitations you described, you can use the method split() string and pick up the substring at position 0. Hence do not know if skipping the second name of people with compound name is a problem for your case
– José Diogo Castro