lixplor / android-Q-A

🐞 android related questions and answers
0 stars 0 forks source link

如何代码实现将应用唤回前台 #56

Closed lixplor closed 7 years ago

lixplor commented 7 years ago

如何代码实现将应用唤回前台

lixplor commented 7 years ago

解决: 模拟桌面图标的Intent, 创建一个Intent, 设置class为androidmanifest中的启动activity, 添加相同的category和action即可. 当应用启动后在前台, 发送intent不会有反应; 当应用启动后在后台, 发送intent会唤回前台; 当应用未启动, 发送intent将启动应用