My application is running normally and when I move on some new activity I used the code as
Intent start=new Intent(current activity.this,new activity.class);
startActivityForResult(start, 0);
finish();
and then when I have to move back to the earlier activity I used the following code
Intent start = new Intent(current activity.this,earlier activity.class);
startActivity(start);
finishActivity(0);
I think in this way the stack of the activities may be clear. And on click of the button or the phone back button I used the following code
Intent startMain = new Intent(Intent.ACTION_MAIN);
startMain.addCategory(Intent.CATEGORY_HOME);
startMain.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(startMain);
But my application is still running in the background. I also used the android:noHistory="true"
app is killed from the background but message appered that app close forcefully. Simple finish();
moves to the last activity.
I also seen the link Quitting an application - is that frowned upon? but I am new so did't get much. Please suggest me some way how can I deal with this.