Question Detail

Hello All,
I have a String Array on an Activity and I want to pass it to next one. I can send String one activity to another by Stuck with Array.
How can I pass array one activity to another activity?Image result for one activity to another


Thread Reply

Anonymous

- 1 years ago

In the first activity:

Intent intent = new Intent(context, NewActivity.class);
intent.putExtra("key", stringArray);
context.startActivity(intent);

 

and in the second one:

Intent intent = getIntent();
String [] stringArray = intent.getStringArrayExtra("key");

Anonymous

- 1 years ago

http://recoverperu.org