Hello I have couple of activities in my app and I want to be able to move between them without to worry that my variable values will get restart every time. I tried to use share permanences but it create my a lot of bugs in the app because they wont go beck to default.
2 回答
AFAIK your variable values will not be affected As long as you don't finish your activity or explicitly reset/change variables values.If you meant to keep variable values you must use some storage machanism. (File / SharedPreference etc)
Vogella has written very good post on Persistence
http://www.vogella.com/articles/AndroidFileBasedPersistence/article.html#overview_fileAPI
You could begin with things like understanding what a "variable" is. Then gradually move to concepts like classes, attributes and methods. When you get those, try and learn developing for Android - things like life cycle of an application will be of interest to you. After some time you will be able to ask the right questions.
Without all these steps you will not be able to get any help, unless you get someone to rewrite your application.