I have a ArrayList
that contain a HashMap
.
One HashMap
Object have 3 key, Value pair.
So it is like this....
Category : A
Name : Name 1
Price : 100
I want to do group by Category and make a list view like this.....
A
===============
Name 1 100
Name 2 100
Name 3 100
B
===============
Name 1 100
Name 2 100
Name 3 100
C
===============
Name 1 100
Name 2 100
Name 3 100
but my listview.xml
is like this.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content""
android:layout_height="wrap_content" >
<TextView
android:id="@+id/category"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<TextView
android:id="@+id/card_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<TextView
android:id="@+id/card_type_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</LinearLayout>
My question is how do I group this arraylist
according to Category
and have a list view.
How I dynamically change the behavior of this list view ??
Because my list view contain all the time these 3 fields.
What is the option that I have ??