• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to call another fragment activity?

 
sam liya
Ranch Hand
Posts: 1246
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this is my main activity which contain viewpager



this is my MyFragment class




inside MainActivity there is a method respond which comes from Interface.I need to call method of MyFragment2.How to get reference tov MyFragment2 from MainActivity?
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I generally use the EventBus library for inner-app communication. That's cleaner than keeping references to GUI elements all over the place.
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!