-5

im follow this post to pass arraylist as parameter to another screen from here Passing a List from one Activity to another now i want to save arraylist in string after get what do i do???

String myvalue; Activity A :

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


   intent.putExtra("arraylist", list);
   startActivity(intent);

   Activity B:

 ArrayList<String> list = getIntent().getSerializableExtra("arraylist");



        how to save list in  myvalue;
        like   myvalue=list;
4

2 回答 2

0

在第一个活动中:

Intent intent = new Intent(this, target.class);
intent.putStringArrayListExtra("name", stringarraysdb);
startActivity(intent);

在第二个活动中:

Intent i=getIntent();
ArrayList ringarraysdb=i.getIntegerArrayListExtra("name");
于 2013-11-28T10:31:16.720 回答
0
Intent intent = new Intent(this, YOUR_CLASS.class);
intent.putExtra("string", list.get(0));
startActivity(intent);

在您的另一项活动中:

String str = getIntent().getStringExtra("string");
于 2013-10-23T11:59:24.033 回答