Pass Data From Activity To Dialog

后端 未结 4 1267
一整个雨季
一整个雨季 2021-01-17 21:31

I am looking for a way to pass data from an activity onto a dialog box. I am trying to call showDialog(int);, however i don\'t see a way to pass any data to the

4条回答
  •  半阙折子戏
    2021-01-17 22:00

    When you are doing showDialog(int) the Activity's onCreateDialog method is called. There you must create a dialog instance and return it, and it will be shown.

    Then you are creating a dialog, you have a full access to your class' fields and can use values of them to adjust parameters and content of created dialog.

提交回复
热议问题