ListView with expandable groups (categories)

English: Food2u running on an Android phone. E...

English: Food2u running on an Android phone. Español: Food2u funcionando en un teléfono Android. (Photo credit: Wikipedia)

Discovery one for today: setting table id as  autoincrement crashes code.  According to docs if field is declared as primary key it will autoincrement by itself. I wonder, why did they decide to crash it, they could have ignored the key word. Anyhow.

The next task is to create categories for input. Design considerations:

Input will be dropdown in the Edit screen with predefined enums. How would I show groups on a front screen? List with categories would be nice.  I’d   to reserve tabs for implementation of multi users.

Let’s explore lists with categories.

There is ExpandableListView

Replaced my old

android:layout_height=”289dp” >


android:layout_height = “match_parent”
</ExpandableListView >

I have to replace ListAdapter with ExpandableListAdapter in java code. reading

This example seems to be what I need

Lunch stop. Stuck on creating this adapter. WTF is groupFrom and groupTo?

After 2 h successfully implemented expandable adapter. Took while to understand what these maps are but I got it!

After my expandable list started to work each time keyboard comes up at a startup. Found a fix by adding this line to manifest as property of this activity  android:windowSoftInputMode=”stateHidden”.


this.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN); or


Tomorrow is all about stabilization.

Other generally useful

Found info on testing . people say  You should have three (3) different devices:
1. One mobile phone (small screen) with Android 2.3 (e.g. HTC Wildfire)
2. One mobile phone (small screen) with Android 4.0+ (e.g. Samsung galaxy s3, s4)
3. One tablet (big screen > 7”) (e.g. Samasung galaxy Note 10.1)

ANother example of expandable list adapter but even less understandable

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s