I have this custom object which I want to pass to a different Activity:
public class FindRouteOutputForDisplay {
public ArrayList<VertexDisplay> vertexDisplayArrayList;
public ArrayList<Integer> integerArrayList;
}
I tried this, but doesn't work.
Intent newIntent = new Intent(FirstActivity.this, SecondActivity.class);
FindRouteOutputForDisplay data = getMyData();
newIntent.putExtra("data", data); // Error
startActivity(newIntent);
Should I pass
public ArrayList<VertexDisplay> vertexDisplayArrayList;
public ArrayList<Integer> integerArrayList;
separately one-by-one? Any way to pass all of them at once?