I have an app that contains a Login Activity , which is shown to the user when the app starts up,the issue is that the app closes without getting a callback to OnDestroy() on back button press

code:-

```
private long lastPressTime = 1;

@Override
public void onBackPressed() {
    long currentTime = System.currentTimeMillis();

    if ((currentTime - lastPressTime) < 2000) {
        System.exit(0);
    } else {
        Toast.makeText(this, "Press again to exit", Toast.LENGTH_SHORT).show();
        lastPressTime = currentTime;
    }
}

```