is it possible to have method onActivityResume
within adapter
& call startActivityForResult
?
Not necessarily pass to pass context in adapter's constructor. You can get context from parent ViewGroup. Sample for RecyclerView adapter:
Context mContext;
@Override
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
mContext = parent.getContext();
...
}
Sample for ListView BaseAdapter
Context mContext;
@Override
public View getView(int position, View convertView, ViewGroup parent) {
mContext = parent.getContext();
...
}
And use it wherever you want
((Activity) mContext).startActivityForResult(intent, REQUEST_FOR_ACTIVITY_CODE);