regarding custom layout

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

regarding custom layout

Postby srujanak » Thu Jan 21, 2010 11:15 am


I'm designing a custom layout using custom Image buttons .I have created the custom buttons and a Custom Linear layout.When I click on button1 for the first time, button2 should be created to its right.when button1 is clicked for the second time, button3 should be created above it,the third click should create button4 to the left and the fourth click should create button5 below it. Button 1,2,3,4,5 would be clones of a parent button.I don't know how to retrieve the IDs of these custom components.

Any ideas on retrieving the ids? there a better approach I can use that does not require ids??

Posts: 3
Joined: Thu Jan 21, 2010 8:57 am


Postby appforce » Thu Jan 21, 2010 2:03 pm


You have to first assign an id before retrieve it. If you're constructing the buttons in run-time within you app code, use setId method, if you inflate from XML resource use android:id attribute.

Android developers
Experienced Developer
Experienced Developer
Posts: 60
Joined: Mon Nov 23, 2009 8:28 pm


Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 5 guests