I'm working on an android application and in the application I have a couple buttons that let user to pass to another activity. Now the way I'm doing the transitions between this Intents is like below:
Intent intent = new Intent(this,user_area.class);
intent.putExtra("user",user_name.getText().toString());
startActivity(intent);
With the above content I start an activity and from that activity I'm getting back to the MainActivity
using this code:
Intent intent = new Intent(context,MainActivity.class);
startActivity(intent);
But i suspect this cause memory to be over used because I'm not actually getting back to the Main Activity
that created when application started, I'm just creating another instance of MainActivity
I guess. Is this really as i thought and if it is how can I get back to the activity that created in the beginning or if I can't do such thing how can I make app to let the previous activity go?