Pass ArrayList From OneActivity to AnotherActivity ?
public class DataWrapper implements Serializable
{ private ArrayList<String> arrayList; public DataWrapper(ArrayList<String> data) { this.arrayList = data; } public ArrayList<String> getArrayList() { return this.arrayList; } } Intent intent = new Intent(SubCat1Activity.this,Full1Activity.class); intent.putExtra("data",new DataWrapper(MainData)); startActivity(intent); DataWrapper dw = (DataWrapper) getIntent().getSerializableExtra("data"); ArrayList<String> list = dw.getArrayList();
No comments:
Post a Comment