My code destroy my current activity and start a new activity, like below:
Intent intent = myActivity.getIntent();
myActivity.finish(); //Destroy my activity
myActivity.startActivity(intent); //Start my new activity
It works, the previous activity is destroyed and new activity starts, but AFTER start the new activity, the activity's onDestroy()
method is called, why?