Reputation: 350
I have a splash activity in my app that launches and then loads the main class after 5 seconds. I'm thinking of changing it to where the splash only displays on the initial launch of the app. I was thinking of just writing a text file to the filesystem and then checking to see if its there. If its found, then dont load the splash screen. Is there a better way of doing a check to see if the app is on the first launch?
Upvotes: 0
Views: 594
Reputation: 128458
Instead of that you can use SharedPreferences because its easy to implement, fetch and take values from it as compared to file system.
Refer this question for the example of SharedPreference: Android-sharedpreference
Upvotes: 5
Reputation: 20155
You can use SharedPreference to save Simple String that represents your Splash screen.
Upvotes: 2