In my App there is three activities: A, B, and C. Activity A is the main activity.
When I start Activity B from A using Intent
, A is automatically destroyed. However, I am not finished with A when I start B. Then, when I press the back button in the device the A is started using onCreate
and I've lost all my data since I am not using an Intent
to go back.
The same happens when opening C from B.
button.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
startActivity(new Intent(ActivityA.this,
ActivityB.class));
}
});
What's going on? How do I fix this?