Communication between Fragment and DialogFragment

后端 未结 2 1160
被撕碎了的回忆
被撕碎了的回忆 2020-12-30 02:34

I\'m trying to make a Fragment to show a Dialog using DialogFragment API.

My dialog only has an EditText view and I want to pa

2条回答
  •  南方客
    南方客 (楼主)
    2020-12-30 02:55

    You can use the setTargetFragment and getTargetFragment methods of Fragment. You can set your Fragment as the target of the DialogFragment and then retrieve a reference to it from within the DialogFragment.

提交回复
热议问题