Android - Best way of avoiding Dialogs to dismiss after a device rotation

Viewed 11784

After a long search around this forum, I found a lot of answers where people propose using solutions for avoiding dialogs to dismiss after rotation, just like:

android:configChanges="keyboardHidden|orientation"

Or override the following method, which appeared to be the most recommended:

protected Dialog onCreateDialog(int id)

But, after look around the Android Reference Documentation, I could notice that these Dialog methods are being deprecated.

So, the obvious question is:

Today, what is the best way of avoiding Dialogs to dismiss after a device rotation?

Thanks in advance.

3 Answers
Related