Android Confirmation dialog returning true or false

前端 未结 8 1271
不知归路
不知归路 2020-12-09 05:40

It seems to be there is no easy way to get an Alert dialog to return a simple value.
This code does not work (the answer variable cannot be set

8条回答
  •  生来不讨喜
    2020-12-09 06:09

    Declare a field 'answer' in your activity and set a value to it. Fields of a class are visible to inner classes, so you can do that.

提交回复
热议问题