Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by GKdev1980 · Mar 24, 2014 at 11:23 PM · androidplayerprefs

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.

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Simon-Larsen · Mar 25, 2014 at 12:21 AM 0
Share

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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

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..

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image GKdev1980 · Mar 31, 2014 at 09:12 AM 0
Share

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.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

21 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Android PlayerPrefs example? (I´m too stupid :c) 1 Answer

Android PlayerPrefs not saving? 0 Answers

I want to use the score I saved in unity in Eclipse to publish to the user's Facebook Feed 0 Answers

Playerprefs don't reset after reinstalling the build on my phone. 1 Answer

PlayerPrefs not saving on Android Phone 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges