Bring application to front after user clicks on home button

后端 未结 7 820
礼貌的吻别
礼貌的吻别 2020-11-28 09:21

My application is in running mode[foreground] and user clicks on home button, which puts application to background[and still running]. I ha

相关标签:
7条回答
  • 2020-11-28 10:10

    From my test, to mimic the Launcher behavior, the key is to:

    intent.setPackage(null);

    after

    Intent intent = packageManager.getLaunchIntentForPackage(pkName);

    Other methods in this thread doesn't work in my case.

    Thanks to jiaqing's answer, I post this answer as I don't have the right to comment. I don't know the logic behind this either, I guess it's related with the task owner. Anyone knows, would be glad to know.

    0 讨论(0)
提交回复
热议问题