i think this will help you........ Button b = new Button(this); b.setText("Dynamic Button"); b.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
On Apr 2, 11:13 am, mnavlani <monishanavl...@gmail.com> wrote: > hello all, > i wanted to create buttons at runtime. The no. of buttons to be > displayed depends upon the input of user. But creating a button > requires some code to be written in the .xml file. so how can i > dynamically generate the code for n no. of buttons at runtime? > > regards! -- You received this message because you are subscribed to the Google Groups "Android Beginners" group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en To unsubscribe, reply using "remove me" as the subject.