I have a RecyclerView and the user can cheer teams on the recyclerview layout or clicks on the items and cheer the teams inside the match page, what i need to do is to update the recyclerview cheers bar in the first layout when ever the user enters the full match page and cheer a team
first recyclerview layout iamge
I need to create some kind of alistener that will be activited in
@Override
public void onBackPressed() {
super.onBackPressed();
Log.d("posss", "onBackPressed:cheeredTeam:"+cheeredTeam);
Log.d("posss", "onBackPressed:pos:" + pos);
// Activite Listener with (recycler position , cheered team )
}
You need to use startActivityForResult(Intent, requestCode)
when starting your full match activity! Then, when the user returns to your RecyclerView, you would want to insert setResult(Intent)
before that. Then, in your fragment create the onActivityResult()
function, that will receive the updated information through the Intent.
Look at this too, when making your onActivityResult method: onActivityResult is not being called in Fragment