I have two activities with fragment1 inside activity1 and fragment2 inside activity2
fragment1 and fragment2 extend from Fragment activity1 and activity2 extend from App
Best way to achieve this is using singleton pattern, you can use it for fragment-fragment, fragment-activity communication.
See this answer, it explained with code there and in a very meaningful way. but what i preferred from my experience is you should user EventBus if you want to handle bigger projects with many fragments and larger dependencies, connections and data flows within and between fragments and activities.
The basic communication can be done as per suggested in Developer documentation here