Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I hide an Activity?

I have Activity that download a file in progress dialog. And when user press to the button "hide" activity creates notification and hide progress dialog. And when user click to the notification, activity showing progress dialog in the activity again. How could I switch activity to the back task on pressing to the button "Back"?

like image 538
ruslanys Avatar asked Feb 19 '23 02:02

ruslanys


1 Answers

If you don't destroy your activity you must set acitvity launch mode to single_instance and use moveTaskToBack(true) to send to background.

like image 197
ariel Avatar answered Feb 27 '23 20:02

ariel