multiuser application managing back stack of each user
<p>everybody</p>

<p>I work on multiuser application, which is REST client, so when you launch it, the 1st activity you see is LoginActivity.</p>

<p>For example, I have ten activities and LoginActivity and I can navigate e.g. next way:
LoginActivity -> Activity1 -> Activity3 -> Activity8(logout) -> LoginActivity.
I can do log out from every activity.</p>

<p>Possible next situation:
<br>1) user1 logged in: LoginActivity -> Activity1 -> .. <strong>Activity7(logout)</strong> -> 
LoginActivity.
<br>2) user2 logged in: LoginActivity -> Activity1 -> .. Activity4(logout) -> LoginActivity.
<br>3) user1 logging in again: LoginActivity -> <strong>Activity7</strong>..
and user1 must <em>naturally</em> go to Activity7 with his last back stack if possible.</p>

<p>Also user must see only relevant for him data.</p>

<p>Is there any mechanisms to manage all this stuff?
I mean, does android platform support such multiuser apps, or restoring/storing back stack manually.</p>

<p>Any other ideas?</p>

<p>p.s. I found workaround to use SharedPrefences for each user to store only <em>his</em> data and store activity he logged in from. But it seems not <em>android way</em> as for me.</p>

<p><strong>UPD:</strong> I done some research, and found out two intent flags to launch new 
task with it`s back stack history: 
(FLAG_ACTIVITY_NEW_TASK  |  FLAG_ACTIVITY_MULTIPLE_TASK) </p>

<p>So, as I understand, in case of above example LoginActivity is 
something like "top level launcher" mention in javadoc of 
FLAG_ACTIVITY_MULTIPLE_TASK. </p>

<p>But, I cannot find docs/sample of top level launcher; how to manage 
tasks by their IDs. 
Please help with top level launcher sample or managing tasks api.</p>

<p><strong>UPD2:</strong> I found how some functions how to manipulate tasks by task id:
<br>
public void moveTaskToFront (int taskId, int flags); 
<br>
but it is only since API level 11
But I use level 7, is there any technique how to move task to foreground?</p>
