Results 1 to 3 of 3
  1. #1

    Lightbulb Array of buttons.

    Some UI problems I have as a C++ designer who turns to Android. Feel free to help with 2 issues.
    I made a complicated layout in Eclipse with 37 buttons on the right and a scrollview with up to 200 items on the left. The 37 buttons can be food or drinks, the scrollview should show the order.

    1. Can following code be done easier:
    item_button[0] =(Button)findViewById(;
    item_button[1] =(Button)findViewById(;
    item_button[2] =(Button)findViewById(;
    item_button[36] =(Button)findViewById(;

    2. I made default 200 items in the scrollview, but that looks clumsy, If I make a layout in XML, is it possible to add buttons to this scrollview?

  2. #2
    hmm... i'll try to ask my friend. i think he knows this.

  3. #3
    I read somewhere it is very slow if you put many buttons in an XML file, although other websites recommend this. Probably I will see in a second version if that is true. Then the problem above is also solved... Lot's of assumptions, but it is true: Compiled code is probably faster than reading an XML file. At least, thanks for your answer and greetings to your friend.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts