handle configuration changes in the fragment and sample application