hi,
how could i get an image and a text from the Internet and made a button for my android application dynamically?And draw them in th position i want. i.e by Java code
thinks
hi,
how could i get an image and a text from the Internet and made a button for my android application dynamically?And draw them in th position i want. i.e by Java code
thinks
Download the image and the text, then:
button.setText(downloadedText);
button.setBackgroundDrawable(drawable);
You'll have to create a Drawable from the image, which you can probably do using Drawable#createFromStream
.
Drawing the button in the position you want is no different from a normal button. Just declare it in your XML (possible set to Visibility.GONE at first), get a reference to it using View.findViewById
and then do the above operations on it.