Note that there are some explanatory texts on larger screens.

plurals
  1. POis it possible that Android loads a fresh instance of previously opened Activity instead of loading some in memory instance?
    primarykey
    data
    text
    <p>I have Activities <strong>A, B &amp; C</strong>.</p> <p><strong>A</strong> loads <strong>B</strong> and <strong>C</strong>.</p> <p><em><strong>BEFORE UPDATE</strong></em></p> <p>i load <strong>B</strong> from <strong>A</strong> ... than i pressed back button and A was loaded... i again loaded <strong>B</strong>.</p> <p>Now is it possible that some previous instance of B is loaded instead of creating a new fresh instance of <strong>B</strong>.. as i am having some weird issues??</p> <p>i want <strong>A</strong> to always load a FRESH instance of <strong>B</strong> .. but dont know how...</p> <p><em><strong>AFTER UPDATE</strong></em></p> <p>I studied the Intent filters and found the following having same concept... so i applied Intent.FLAG_ACTIVITY_NEW_TASK &amp; Intent.FLAG_ACTIVITY_CLEAR_TASK to force android to always load a fresh copy of <strong>B</strong></p> <pre><code>// THIS CODE IS IN ACTIVITY A -- TO LOAD ACTIVITY B Intent intent = new Intent().setClass(A.this, B.class); //Trying to force it to load a fresh instance of B intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK); startActivity(intent); </code></pre> <p><strong>Now</strong> It loads B, i suppose a fresh copy.. but when i press BACK button, it closes the App instead of showing main activity <strong>A</strong> which loaded <strong>B</strong>.. I think above flags causes activity <strong>A</strong> to close after loading activity <strong>B</strong>.. i m not sure</p> <p>Any help is greatly appreciated</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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