Just on Question. hope you have a sec to help me.

if i have many drawables to request like

        mbs[0] = (Button) findViewById(R.id.cmd_door_0);mbs
[0].setOnClickListener(myOcl);
        mbs[1] = (Button) findViewById(R.id.cmd_door_1);mbs
[1].setOnClickListener(myOcl);
        mbs[2] = (Button) findViewById(R.id.cmd_door_2);mbs
[2].setOnClickListener(myOcl);
        mbs[3] = (Button) findViewById(R.id.cmd_door_3);mbs
[3].setOnClickListener(myOcl);
        mbs[4] = (Button) findViewById(R.id.cmd_door_4);mbs
[4].setOnClickListener(myOcl);
       .. lets say up to 100;

is it possible to create that in a loop like:

                for (int i = 0; i <= 41; i++)
                {
                  mbs[i] = (Button) findViewById("R.id.cmd_door_"+i);mbs
[i].setOnClickListener(myOcl);
                }

. i know its not working in that style
but is it possible to create IDs like R.id.cmd_door_xxx (where just
xxx change) in a loop?

Hope you understand how i mean this :)

Greets
Chris
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to