• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to call another fragment activity?

 
sam liya
Ranch Hand
Posts: 1243
  • 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: 42969
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic