If you override Activity#onCreateDialog method to create a pop-up dialog something that you have to be aware is this dialog will be cashed for any subsequent calls. For most cases it is just the right behavior but what if you want to change contents of the dialog on the next call? One possible scenario – say you have few tabs that display similar content in the same pop-up but the info changes based on the active tab. Here’s one way to do it. When you set your onClick listener put this into onClick call:
dialog.dismiss();
activity.removeDialog(DIALOG_ID);
Here DIALOG_ID is the same ID you are using in the Activity#onCreateDialog call
| M | T | W | T | F | S | S |
|---|---|---|---|---|---|---|
| « May | ||||||
| 1 | 2 | 3 | 4 | |||
| 5 | 6 | 7 | 8 | 9 | 10 | 11 |
| 12 | 13 | 14 | 15 | 16 | 17 | 18 |
| 19 | 20 | 21 | 22 | 23 | 24 | 25 |
| 26 | 27 | 28 | 29 | 30 | 31 | |