In 'subcribe' of 'BehaviorSubject', receive 'ArrayList' as a parameter to process data. If you try to pass the accepted data into the Intent and finish it, the app is stopped. What's the problem?
subject(requestData)
.map(r->arrayList = r.getArrayList())
.observeOn(Android.Schedulers.mainThread())
.subscribe(r->{ finishWithData(r)});
private void finishWithData(r) {
Intent intent = new Intent();
intent.putExtra("array", r);
setResult(Activity.RESULT_OK, intent);
finish() // Here is Crash Point.
}