I have two activities. The first activity is running in the foreground. While pressing the home button, the first activity goes to the background and calls the service from there second activity is started using intent. Now the first activity is shown on top. I want to hide both of the activities in the background.
Starting the second Activity
:
Intent intent1 = new Intent(XXX.this,yyy.class);
intent1.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
intent1.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent1);