In the main activity there is a fragment that has RecyclerView. When a user clicks an item in the RecyclerView, I am calling ((Activity)v.getContext()).startActivityForResult(intent, Config.REQUEST_ATTENDEES)
from my adapter and I handled this request on my onActivityResult
method in my main acitivity. And inflate fragment again from onActivityResult
. My onActivityResult
get triggered but after get triggered, my main activity calls onDestroy
. Here below are resources that I looked:
can we call startActivityForResult from adapter?
onActivityResult no longer being called after onDestroy
I'm thinking second one can be my problem but I'm not sure because in my adapter, (Activity)v.getContext()
should be my main activity. Any suggestion would be nice.