I have an Activity that I display as modeless when the phone rings (over the phone app). I would like to finish the Activity when either of the following events occur. The f
After a long R&D over internet i have solved my problem. The below code is helpful if you start an activity from broadcast receiver and clear all activity stack instance.
@Override
public void onBackPressed() {
if (drawer.isDrawerOpen(GravityCompat.START)) {
drawer.closeDrawer(GravityCompat.START);
} else {
moveTaskToBack(true);
}
}