Fragment communication use variable declared in the activity in fragments

I'm using fragment communication using based activity. So I know its is possible to use base activity methods in all fragments. My situation is like this,

My base activity has a List. In my fragments I want to add elements to that list like this,

Fragment[1] -> list.add(element1) Fragment[2] -> list.add(element2) Fragment[3] -> list.add(element3)

After that I remove Fragment[3]. But still I want to use that element3 in Fragment[2].

Will I able to this using fragment communication. Or is this whole thing ridicules idea?

Category:android Views:2 Time:2018-05-28

Related post

Copyright (C) dskims.com, All Rights Reserved.

processed in 0.113 (s). 11 q(s)