0

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?

1 Answer 1

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

Sign up to request clarification or add additional context in comments.

2 Comments

Great tips, but I really need to stick to the design and the design looks like a list. ListView it is, then?
@Maarten: "ListView it is, then?" -- that is up to you. If you do use a ListView, you need a ListAdapter.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.