views:

38

answers:

1

Im trying to send a List to next activity the list

List mGF = new ArrayList();

i cant figur it out... i have read and try for days...

Intent i = new Intent(mContext, ViewImages.class); i.put....? (mGF);

How do i send and how do i get it as mGF in the next activity

hope you understand

A: 

Haven't tried this but thought the questions was interesting.. so I went searching

In the Intent documentation there are quite a few different ArrayList type put??extra methods. Depending on the type of your ArrayList you should use one of them.

ex

ArrayList<String> mGF = new ArrayList<String>();

Intent i = new Intent(mContext, ViewImages.class);
i.putStringArrayListExtra("package prefix"."whateverYouWannaNameIt",mGF);

Then you use getStringArrayListExtra("package prefix"."whateverYouWannaNameIt")

I fell over this when I was looking around for some solutions for your problem that might help.

Rasmus
Thanks! got it working!Just added (ArrayList<String>)i.putStringArrayListExtra("com.packageprefix",(ArrayList<String>) mGF);
FoJjen
great! Glad it worked :-)
Rasmus