How do I go about setting my Fragments
by tag since I did not explicitly make them in my XML
so I can't use findbyID
.
I have 4 Fragments
in an Activity and want to pass data back and forth from the Fragments
but I keep getting error
Attempt to invoke virtual method 'void com.project.myproject.app.Fragment.addToList()' on a null object reference
I don't think I am setting my Fragment's
tags right so could someone please link me to an example of this?
Set the tag for fragment:
Get the fragment: