我需要传递对通过bundle进行大部分处理的类的引用.
问题是它与意图或上下文无关,并且具有大量非原始对象.如何将类打包成parcelable/serializable并将其传递给startActivityForResult?
我试图将一个arraylist传递给我的父母活动
这是简单的代码.
private ArrayList<Receipt> receipts = new ArrayList<Receipt>();
Intent data = new Intent();
data. // what to do here?
setResult(RESULT_OK, data);
//************************************
Run Code Online (Sandbox Code Playgroud)
这是基本收据类
public class Receipt {
public String referenceNo;
public byte[] image;
public String comments;
public Date createdOn;
public Date updatedOn;
Run Code Online (Sandbox Code Playgroud)
告诉我如何在我的意图中添加它以及如何在父活动中将其检索回来
onActivityResult(final int requestCode, int resultCode, final Intent data)
Run Code Online (Sandbox Code Playgroud)