How do I save data in my current activity so that i can access it next time on same activity Android?
<p>i have a listview in which i have some list of data i am sending it to other activity on click</p>

<p><strong>i am sending data with intent</strong> </p>

<pre><code>Intent i = new Intent(MainActivity.this,AppDiscription.class);
                    i.putExtra("NAME", s);
                    i.putExtra("AMT", Appname);
                    i.putExtra("COUNT", cnvert);
                    i.putExtra("SELECTEDID", selectedFromList);
                    startActivity(i);
</code></pre>

<p><strong>on receiving activity:</strong></p>

<pre><code>if (extras != null) {

            Appname = extras.getString("NAME");
            total = extras.getString("AMT");
            count = extras.getString("COUNT");
            selected = extras.getString("SELECTEDID");
}
</code></pre>

<p>now i have to save "<strong>selected</strong>" into a variable on this activity so that i can compare it with new "<strong>selected</strong>" data which will came with next intent when i will click on listview.</p>
