Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Minimize" an Activity in Android (don't finish it)

I want to "minimize" the application, leaving it in background doing exactly the same that when the home button is pressed when the user clicks a button (but don't finish it) How can I do that?

like image 474
Addev Avatar asked Nov 23 '11 01:11

Addev


People also ask

How do I pause activity on Android?

Pause Your Activity You should usually use the onPause() callback to: Stop animations or other ongoing actions that could consume CPU. Commit unsaved changes, but only if users expect such changes to be permanently saved when they leave (such as a draft email).

How do I minimize an app on Android?

You can minimize the apps or actually have it as a popup: Tap your home multi-screen window. Touch and hold the app you want to minimize. You can open "Option" menu on the top of the page and drag and drop, minimize, go full screen, or close the app here.


1 Answers

You can use the moveTaskToBack(boolean) method of Activity.

like image 148
Ted Hopp Avatar answered Oct 14 '22 13:10

Ted Hopp