If killing the process is not a desirable option, what should I do?
Nothing, most likely.
I know that finish will finish the activity but why is it still visible in the task manager?
First, your process is still running. This is an optimization, so if the user elects to return to your app right away, or something else triggers your app code (e.g., AlarmManager
), Android does not have to waste CPU and battery forking another process for you right away. Android will terminate your process when it deems this to be appropriate.
Note that depending on what you consider the "task manager" to be, your app may appear there anyway, even if your process is terminated. For example, long-pressing HOME or pressing the RECENTS button brings up "recent tasks", which includes tasks for which the process has been terminated.
it's like not really professional showing the progress bar within the app in the application task manager
I have no idea why you would think that. That being said, you are welcome to override onCreateThumbnail()
in your activities to return something else to use for the thumbnail image.