-
-
Notifications
You must be signed in to change notification settings - Fork 305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to recreate/refresh a FragmentSlide #105
Comments
The simplest solution would be to either remove and re-add the specific fragment or much simpler just call |
Actually |
So why do you change the theme in the intro? Not really a usecase I can imagine... Also changing the language is not very common so that should probably not be in the intro. Remember the intro is there to show your users the most important features of your app or to let them make settings the app can't work without. A better user experience would be to set the app language to the devices language per default and letting users change that on a separate settings page. I guess most of the users want their apps to have the same language as their device anyway, so why should you interrupt them with such an obvious question. Both the night mode option and the language preference are things only very few of overall users will want to change. Both of them belong in the settings activity. To address this issue technical, when you call |
In my case the user can select an app theme and instantly see what it looks like. Yeah of course i could apply the theme after the intro, but then the user would know how it looks and maybe has to go into the settings to change it back. |
I have 2 FragmentSlides. In the first slide, the user defines the app language. In the second slide, the user defines day/night mode. Both the information will be saved using SharedPreferences.
Now I want to recreate/refresh/update the current fragment with user-defined preferences. To elaborate, in 1st slide the default language is English. The user defines the app language to German. Likewise in the 2nd slide, the default mode is day mode. The user defines the default to night mode. I need to recreate the fragment, in order to display the contents of the Fragment in German in night mode.
I am not sure on how to recreate the Fragments. I tried the below code.
(I knew) it hasn't worked as expected.
getActivity().recreate()
recreates an activity. this means the activity will be displaying both the fragments right from the beginning (which I don't want).If the user was in the second fragment, then on recreate/refresh, I want only the second fragment to be displayed to the user. How can this be done?
Regards
The text was updated successfully, but these errors were encountered: