Ok. So in this case, is there a way to dynamically create imageviews from the code (not xml) based on number of images to display ? Or should i just statically create 4 imageviews and only populate them based on the number of flowers i want to display ?
On Jul 27, 10:52 am, Justin Anderson <janderson....@gmail.com> wrote: > No... displaying the number of flowers is NOT the same as replacing the word > "flower" with an image, which is what you originally described. > > To display 4 flower images you would need 4 ImageViews. To display 3 flower > images you would need 3 ImageViews. > > ---------------------------------------------------------------------- > There are only 10 types of people in the world... > Those who know binary and those who don't. > ---------------------------------------------------------------------- > > On Tue, Jul 27, 2010 at 8:25 AM, ethan <puripun...@gmail.com> wrote: > > You are correct. > > > Instead of displaying the number 4, or 3 or 2 or 1, i want to display > > 4 flowers, or 3 flowers, or 2 flowers... > > so you are saying that i can achieve that with one imageview ? > > > On Jul 27, 9:18 am, Justin Anderson <janderson....@gmail.com> wrote: > > > Unless I am misunderstanding, you would only need one ImageView... You > > said > > > you want to replace the word "flowers" with an image, right? Not the > > number > > > 4? If that is really what you would want to do then you would only need > > one > > > ImageView... > > > > ---------------------------------------------------------------------- > > > There are only 10 types of people in the world... > > > Those who know binary and those who don't. > > > ---------------------------------------------------------------------- > > > > On Tue, Jul 27, 2010 at 8:01 AM, ethan <puripun...@gmail.com> wrote: > > > > Justin > > > > Thanks for the reply. What i am trying to do is following: > > > > > Based on code logic, i am trying to print on the screen " There are 4 > > > > flowers". > > > > However instead of using the word flowers, i want to put icon of > > > > flowers in its place. The icon is stored as a jpeg in my res/drawable > > > > folder. The number of flowers can vary from 1 to 4. > > > > > So do i first need to create 4 imageviews in my layout and then call > > > > each one out separately using setimageResourse ? > > > > > On Jul 27, 3:26 am, Justin Anderson <janderson....@gmail.com> wrote: > > > > > When you say "load an image" do you mean just display it somehow? If > > so, > > > > > then just create a new activity with an ImageView in it and call > > > > > setImageResource on the view. > > > ---------------------------------------------------------------------- > > > > > There are only 10 types of people in the world... > > > > > Those who know binary and those who don't. > > > ---------------------------------------------------------------------- > > > > > > On Mon, Jul 26, 2010 at 10:24 PM, ethan <puripun...@gmail.com> > > wrote: > > > > > > Hi, > > > > > > I am trying to load an image from my res/drawable folder to my app > > by > > > > > > pushing a button on my application. > > > > > > > What is the easiest way to achieve this ? > > > > > > > Thanks > > > > > > > Ethan. > > > > > > > -- > > > > > > 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<android-beginners%2bunsubscr...@googlegroups.com> > > <android-beginners%2bunsubscr...@googlegroups.com<android-beginners%252bunsubscr...@googlegroups.com> > > > > > <android-beginners%2bunsubscr...@googlegroups.com<android-beginners%252bunsubscr...@googlegroups.com> > > <android-beginners%252bunsubscr...@googlegroups.com<android-beginners%25252bunsubscr...@googlegroups.com> > > > > > > > For more options, visit this group at > > > > > >http://groups.google.com/group/android-beginners?hl=en > > > > > -- > > > > 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<android-beginners%2bunsubscr...@googlegroups.com> > > <android-beginners%2bunsubscr...@googlegroups.com<android-beginners%252bunsubscr...@googlegroups.com> > > > > > For more options, visit this group at > > > >http://groups.google.com/group/android-beginners?hl=en > > > -- > > 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<android-beginners%2bunsubscr...@googlegroups.com> > > For more options, visit this group at > >http://groups.google.com/group/android-beginners?hl=en -- 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