开发者

Send List to new activity

Im trying to send a List to nex开发者_如何学JAVAt 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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜