Android: Programmatically open “Recent Apps” dialog

前端 未结 3 1578
梦毁少年i
梦毁少年i 2020-12-05 11:42

I would like to be able to open the \"Recent Apps\" dialog from my application. This is the dialog that is opened by long-pressing the home button. I am programming for Andr

3条回答
  •  遥遥无期
    2020-12-05 12:42

    You cannot access that. However, it isn't super hard to roll your own. The getRecentTasks() method returns a list of recently run apps. Simply take the list and add your own UI to it.

    One advantage to this is that the default one, at least on older versions of Android, only shows you about 8 apps. If you roll your own can show as many as you want.

提交回复
热议问题