Thiru Thiru - 1 year ago 98
Android Question

How to pass a String array value from one activity to another Activity in android?

I am having two activities in my application. I want to pass tha array of String from one activity to another.. How to pass this values from activity to activity?

Answer Source

You can consider using Intent.getStringArrayExtra

In the first activity:

Intent intent = new Intent(context, NewActivity.class);
intent.putExtra("string-array", stringArray);

and in the second one:

Intent intent = getIntent();
String [] stringArray = intent.getStringArrayExtra("string-array");
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download