DialogFragment Android 4.x backwards compatibility

The things we as Android developers have to deal with because the cellphone Carriers (though cell phone makers are also responsible partially) refuse to all updates to go to users so they can sell them a new phone :-P

Apparently, the inflator being passed to OnCreateView in a DialogFragment is not the correct one: https://code.google.com/p/android/issues/detail?can=2&start=0&num=100&q=&colspec=ID%20Status%20Priority%20Owner%20Summary%20Stars%20Reporter%20Opened&groupby=&sort=&id=169760

You also have to have your class extend v7.app.AppCompatDialogFragment (you used to only need to extend v4.app.DialogFragment) and if it’s an AlertDialog, be sure to use v7.app.AlertDialog. A lot of old legacy code (if your app is just 2 years old) that extended DialogFragment has to be changed :-(

Like what you read? Give Ken Yee a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.