Reputation: 7559
I am passing data from an activity to fragment by using following code.
Bundle bundle= new Bundle();
bundle.putString("seatId", seatId);
fragment.setArguments(bundle);
Then I consume the data by using following code in my fragment.
Bundle args = getArguments();
if(args!=null && args.getString("seatId")!=null){
matchId = args.getString("seatId", "");
}
Now after this I want to set bundle to null.
The issue is once I set data to fragment through bundle, it keeps it there.
Upvotes: 0
Views: 59
Reputation: 2844
Get hold of the bundle or simply getArguments().clear()
as stated here.
Upvotes: 1