-2

How to programmatically, e.g. using a button, make the app switch to background mode. Actually, I mean the action that the "home screen button" does, but I want to programmatically do it on my button. Thanks.

finish();
System.exit(0);

Cause exited from app.

andtompoi
  • 59
  • 7

1 Answers1

0

you can use below backstack function to move the app to background mode:

moveTaskToBack(true)

Sukhvir
  • 66
  • 2