putParcelableArrayListExtra
而不是
putExtra
Intent mIntent = new Intent(FirstActivity.this, SecondActivity.class);
mIntent.putParcelableArrayListExtra("Data", mArraylist);
startActivity(mIntent);
或者
尝试如下使用gson
Gson gson = new Gson();
String jsonprofileList = gson.toJson(profileList );
Intent intent = new Intent(FirstActivity.this, SecondActivity.class);
intent.putExtra("profile_list ", jsonprofileList );
startActivity(intent);
像这样接受它
String profileListAsString = getIntent().getStringExtra("profile_list");
Gson gson = new Gson();
Type type = new TypeToken<List<modelClass>>(){}.getType();
List<modelClass> profileList = gson.fromJson(profileListAsString , type);