Not only should he go through the documentation for ArrayList, but the Collections Tutorial at http://download.oracle.com/javase/tutorial/collections/TOC.html. For it is clear that this is a Java question, not an Android question, and one well dealt with by the Tutorial Trail on Collections.
On Jul 13, 7:46 am, "A N K ! T" <[email protected]> wrote: > @ shruthi > > as Durgadoss gave u clear example. u can add any number of item at run time. > with specifying it. > go through documentation of ArrayList > > -- > Regards, > Ankit > > On Wed, Jul 13, 2011 at 7:34 PM, Justin Anderson <[email protected]>wrote: > > > You are getting arrays and ArrayList mixed up... ArrayList is dynamic and > > you can modify it at runtime. > >http://developer.android.com/reference/java/util/ArrayList.html > > > Thanks, > > Justin Anderson > > MagouyaWare Developer > >http://sites.google.com/site/magouyaware > > > On Wed, Jul 13, 2011 at 8:00 AM, Shruthi Varma > > <[email protected]>wrote: > > >> Hi, > > >> You didn't get my point. > > >> After parsing that xml, I will get a number of magazines (images). > > >> I have to store all the images of each magazine in a separate ArrayList. > > >> If I know in advance that I will get 3 magazines, I can initialize 3 > >> ArrayList and store images in it as you said. > > >> But the number of magazines can change from time to time (in the server > >> side). > > >> So, how can I initialize "n" number of ArrayList where n is determined at > >> runtime. :( > > >> Regards, > >> Shruthi. > >> On Wed, Jul 13, 2011 at 6:41 PM, Durgadoss Ramanathan < > >> [email protected]> wrote: > > >>> Hi Shruti, > > >>> I do not clearly understand what you mean by "not usable at runtime" > > >>> For example, > > >>> In the Beginning, you initialize an ArrayList like this: > > >>> ArrayList<String> mNames = new ArrayList<String>(); > >>> In your parsing code, as when you discover an item, you can do: > > >>> mNames.add(item.toString()); > > >>> I hope this helps you to an extent.. > > >>> -- > >>> Regards > >>> Durgadoss > > >> -- > >> You received this message because you are subscribed to the Google > >> Groups "Android Developers" group. > >> To post to this group, send email to [email protected] > >> To unsubscribe from this group, send email to > >> [email protected] > >> For more options, visit this group at > >>http://groups.google.com/group/android-developers?hl=en > > > -- > > You received this message because you are subscribed to the Google > > Groups "Android Developers" group. > > To post to this group, send email to [email protected] > > To unsubscribe from this group, send email to > > [email protected] > > For more options, visit this group at > >http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

