Use ActivityCompat.recreate() to emulate the recreate behavior on Android Pie on older Android versions.
ActivityCompat.recreate()