Robust way to pass value back from Dialog to Activity on Android?

后端 未结 3 447
北荒
北荒 2020-12-28 11:03

This question has come up several times and I\'ve read all the answers, but I haven\'t seen a truly robust way to handle this. In my solution, I am using listeners from the

3条回答
  •  天命终不由人
    2020-12-28 11:28

    You can fire off an Intent from your Dialog's onClickListner which the Activity will be listening for.

    Take a look at this tutorial on Broadcasting and Receiving Intents

提交回复
热议问题