Thiru Thiru - 1 month ago 4
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

You can consider using Intent.getStringArrayExtra

In the first activity:

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

and in the second one:

Intent intent = getIntent();
String [] stringArray = intent.getStringArrayExtra("string-array");