Re: [android-beginners] Re: how to dynamically create buttons?

2010-04-02 Thread ~ TreKing
On Fri, Apr 2, 2010 at 2:28 AM, mnavlani  wrote:

> Now i want to use this image for the dynamically created imagebutton...how
> can this be done??
>

If you take 2 seconds to read the documentation on ImageButton you will find
that it's quite simple to set which image it uses.

-
TreKing - Chicago transit tracking app for Android-powered devices
http://sites.google.com/site/rezmobileapps/treking

-- 
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.


[android-beginners] Re: how to dynamically create buttons?

2010-04-02 Thread mnavlani
thanks paresh!
i think this might help..
hey,
actually,the server would return an image at runtime. Now i want to
use this image for the dynamically created imagebutton...how can this
be done??

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.


[android-beginners] Re: how to dynamically create buttons?

2010-04-02 Thread paresh mayani
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  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.