The main menu of my app is a list of items that has a very specific look. It has a custom divider and every list element has a custom colour and height. To achieve this is have built a custom ArrayAdapter, but I wonder whether this is really necessary. The buttons in the main menu are always the same, so I wonder what's the better design pattern here. Pure XML or overriding the ArrayAdapter?
Asked
Active
Viewed 454 times
1 Answers
1
You cannot create a "Custom ListView for main menu purely in XML not using a programatically defined custom adapter". ListView
requires a ListAdapter
, whether you like it or not.
That being said, I would not put "buttons" in a ListView
in the first place. Ideally, you would not even have a "main menu of [your] app", but rather would take the user someplace useful when they launch it. If you are sure that you need to have an activity that is a "main menu", use the dashboard pattern: Android Dashboard Pattern

Community
- 1
- 1

CommonsWare
- 986,068
- 189
- 2,389
- 2,491
-
Great tips, but I really need to stick to the design and the design looks like a list. ListView it is, then? – Maarten Apr 16 '12 at 18:10
-
@Maarten: "ListView it is, then?" -- that is up to you. If you do use a `ListView`, you need a `ListAdapter`. – CommonsWare Apr 16 '12 at 18:16