Call a Fragment method from an Adapter

前端 未结 3 437
长发绾君心
长发绾君心 2020-12-07 20:24

I have a method sendData() in my fragment. This method starts a new Activity. I want to call this method from my ArrayAdapter.

Here is my c

3条回答
  •  时光说笑
    2020-12-07 21:12

    I know it's late to answer but There are 2 ways more to do it:

    1. You can also send broadcast from adapter and register it in fragment.

    2. Use interface. Refer this SO question for details.

提交回复
热议问题