How do I pass a variable through a FragmentPagerAdapter to a Fragment?

前端 未结 2 492
陌清茗
陌清茗 2020-12-30 06:52

I\'m an android beginner, trying to learn, and this is my first question, so please excuse me if the question is too simple and please tell me if I\'m using the forum incorr

2条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-30 07:26

    Problem over. I found out (from the link below) how a fragment can call a method in its activity. That method is providing the value. I'm not sure it's the best way but it's simple and it works.

    Passing data between a fragment and its container activity

提交回复
热议问题