V
V
Vlad1612014-03-07 20:00:22
Android
Vlad161, 2014-03-07 20:00:22

how to customize listview in android

There are two ArrayList with string data. I made a separate screen where I indicated 2 textView. You need to display one arraylist in one textView, and the second in another.
I just don’t understand how to write it in the adapter, my example for a single output:

ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
                    R.layout.books_test_list, title);

R.layout.books_test_list - newly created screen with textView
title - ArrayList with data.
It should be something like this hashmap_object.png
. Examples on the web use separate classes, tags and hashMap, etc. , and I just have 2 ArrayList.

Answer the question

In order to leave comments, you need to log in

5 answer(s)
A
Alexey, 2014-03-07
@Alexious_sh

Obviously, the usual ArrayAdapter will no longer suit you.
There are at least two options here: write your own adapter, extending BaseAdapter, or cast data to List<? extends Map> and use SimpleAdapter.

D
Dave, 2015-06-14
@HeartOfProgrammer

The only and most effective way is to start doing something. That is, there will be no such thing that you started to do and did not learn anything at the same time. This method is the most reliable. Start writing a training CMS. Look in reference books as you come across questions.
And yes, if possible, go work as an intern, even for food.

G
GPK1929, 2015-06-14
@GPK1929

Set the task, for example, to implement a news site with the addition of news from the admin panel + the implementation of the search for the desired article by tag and practice on your health.

B
Boris Yakushev, 2015-06-14
@za4me

Practice on a local server

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question