Android: how to pass ArrayList<object> from an activity to another

前端 未结 2 829
梦毁少年i
梦毁少年i 2021-01-21 18:11

The object in the arraylist is defined in an external library. The object contains some int values and also a float[].

How can I pass all the ArrayList from an activity

2条回答
  •  旧时难觅i
    2021-01-21 18:54

    Intent intent = new Intent(this, TargetActivity.class);
    intent.putExtra("nameOfArray",YOUR_ARRAY_LIST);
    startActivity(intent);
    

提交回复
热议问题