I have the following:
- MainActivity
- Fragment1 with recylerview
- SimpleAdapter
Des of the RecyclerView.Adapter
when doing click send a Intent
with startActivityForResult
((Activity) mContext).startActivityForResult(item.getIntent().addFlags(Intent.FLAG_ACTIVITY_NEW_TASK), 0x600);
To capture the result I do it at MainActivity
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
Log.d(TAG, "onActivityResult() called with: requestCode = [" + requestCode + "], resultCode = [" + resultCode + "], data = [" + data + "]");
}
Here everything is correct, I receive the result perfectly, but I would like the result to be computed in Fragmento1
to make changes in RecyclerView
.
I see that in Fragment you can use onActivityResult
but it does not capture anything.
Is there any way to delegate the onActivityResult of the activity to the fragment?