Is it possible to move the app in background when we click on device back button in android?
background means application moves to screen(application) from where it launches ?
An app is running in the background when both the following conditions are satisfied: None of the app's activities are currently visible to the user. The app isn't running any foreground services that started while an activity from the app was visible to the user.
Try Using
@Override
public boolean onKeyDown(int keyCode, KeyEvent event)
{
switch(keyCode)
{
case KeyEvent.KEYCODE_BACK:
moveTaskToBack(true);
return true;
}
return false;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With