neteinstein
neteinstein

Reputation: 17613

Android: Single Activity & Multiple Views

I have a very specific situation where i found that a single activity generating multiple views is the most correct approach:

To use this, i build only one activity that decodes the code sent from the server and builds the view...

When i pass from a screen from this activity to another screen of this activity, retrieving more server-code on press of a button, it's all ok. But... when pressing back, the last view has also been altered.

I understand this, the activity being used is probably the same.. how can i avoid being the same?

Upvotes: 1

Views: 1265

Answers (2)

Anildhara
Anildhara

Reputation: 197

You can use a Singleton Class which is initiated only once and retain values.

Upvotes: 1

neteinstein
neteinstein

Reputation: 17613

Found the problem. Really stupid... I had a static variable that was accessed onResume so it messed all up...

Upvotes: 0

Related Questions