Android - save value of member field in Fragment class
I'm trying to do something using a boolean in a Fragment class each time the Fragment is displayed. Example My app launches, opens the FirstFragment and the boolean for the first time is always true , then I have an if clause that checks its value: if (FirstTime) { FirstTime = false; } else { // Other stuff here, cause it's not true. } Then, on the first time, when FirstTime is true , I do stuff like go to another Fragment . and when I return to Fragment1 and on my onCreate() , I do the same. It's always true , seems that it's refreshing or something. Then I thought that could be a problem