Win a copy of OCP Java SE 8 Programmer II Exam Study Guide this week in the OCP forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how to call another fragment activity?  RSS feed

 
Ranch Hand
Posts: 1280
  • 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?
 
Rancher
Posts: 42975
76
  • 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
Boost this thread!