Android scenario where ondestroy() is called without onpause() or onstop()
A few days back I was asked to write down scenarios where ondestroy() is called without onpause() or onstop() being called. Is it possible. If yes please explain. If you try below code, you will find a scenario where onDestroy() is indeed getting called while onPause() and onStop() Life-cycle call backs are Skipped. @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); finish(); } @Override protected void onDestroy() { // TODO Auto-generated method stub super.onDestroy(); Log.e("MainActivity", "onDestroy"); }