Note that there are some explanatory texts on larger screens.

plurals
  1. POIs static variable really safe to exchange data between activities?
    text
    copied!<p>I'm working on an application that consist of a couple of activities:</p> <ul> <li>Activity 1: main screen of an application with a "Start" button </li> <li>Activity 2: user selects its identity from the list (more than one user is going to use the application)</li> <li>Activity 3: user inputs password</li> <li>Activity 4: user chooses an event from a timetable (every user has its own timetable with associated events)</li> <li>Activity 5: user can choose an action connected with an activity. </li> <li>Activities 6-10: user performs appropriate action. </li> </ul> <p>Below some more information:</p> <ul> <li>every activity from 6-10 have to know what user is logged in and what event has been selected</li> <li>every activity from 6-10 has a menu that allows the user to go back to activities: 1 (to log out), 4 (to select different event), 5 (to select different action)</li> </ul> <p>Since now, I've been using bundles to exchange data between activities but it seems to complicate the code as the number of actions grow (some actions use a 3-4 activities to collect data from the user). Passing all the data to every created activity doesn't seems to be nice.</p> <p>I'm thinking about storing the "user name" and selected "event" as a static fields of a class. I will simplify the code very much, but I'm not sure whether this data will persist if the user let say at some point press "home button" and run another application that needs a lot of memory. </p> <p>Will the data stored in static fields be safe?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload