Ok, here's the problem. I have a layout file with 25 ImageButtons in in
laid out in a 5x5 grid. During my application setup, I need to go
through and add onClick and onLongClick handlers to each button and add
the buttons to a local array. The problem is, I don't want to explicitly
name every
Try Resources#getIdentifier().
Ok, here's the problem. I have a layout file with 25 ImageButtons in in
laid out in a 5x5 grid. During my application setup, I need to go
through and add onClick and onLongClick handlers to each button and add
the buttons to a local array. The problem is, I
Alternatively, you could just create and set up these 25 buttons in code.
for (int i = 0; i R.attr.GRID_SIZE; ++i) {
for (int j = 0; j R.attr.GRID_SIZE; ++j) {
ImageButton button = new ImageButton(this);
setupButton(button,i,j);
Thank you. I knew there had to be a way.
Mark Murphy wrote:
Try Resources#getIdentifier().
Ok, here's the problem. I have a layout file with 25 ImageButtons in in
laid out in a 5x5 grid. During my application setup, I need to go
through and add onClick and onLongClick handlers to each
4 matches
Mail list logo