- Home /
Double icon in Android app drawer
Ok, here's the thing. I'm trying to save a variable value (a score) to my device when I quit my game and restore it when I relaunch it.
I've got an OnDestroy() method where I'm doing my Player.Prefs.SetInt("variableName", value); saving, and in my Start() doing I'm doing my variableName = PlayerPrefs.GetInt("variableName",defaultValue); loading..
I quit my app by calling Application.Quit() method..
The loading/saving works fine every single time in Unity with play/pause..
I tried testing my app by building it into an .apk and installing it to my phone, but it behaves rather strangely. Sometimes it works like a charm. Then I change something simple in the code, like a string or something, recompile it and re-install it to my phone and it doesn't seem to save (although it still works just fine inside Unity).
I also noticed something else. When I recompiled the project and installed it to my phone, I could see 2 icons in my app drawer, both referring to the same app.
I was wondering if I messed up something in build settings or something.
I think changing the Bundle ID may be the reason you got multiple apps on your device. Just remember that reinstalling the app doesn't clear the cached data. $$anonymous$$eaning that it remembers you data even though you uninstalled/reinstalled your app
Answer by GKdev1980 · Mar 31, 2014 at 09:08 AM
It seems the reason it didn't always save on exit on my phone had to do with me not using a PlayerPrefs.Save() statement..
I will change the title to something more descriptive for the double icon part..
I tried using the same Bundle ID as Simon suggested, but I still get the same result.
I completely removed my app, deleted all cache and game data and I still get 2 icons in my app drawer. I don't know if changing the Bundle ID once (I did it once in the beginning, I thought I was just updating the app version say from 1.0 to 1.1) did such irreversible bad.