首页
注册
登录
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请
登录
›
Android Studio
广告
V2EX
›
Android
[android 开发] 求问怎么制作一个返回 application 的 notification
vjnjc
·
2017-03-16 15:56:06 +08:00
· 4458 次点击
这是一个创建于 2606 天前的主题,其中的信息可能已经有所发展或是发生改变。
一直想实现一个这样的功能,点击 notification 回到程序最近一次打开的界面,就跟在手机桌面点击程序图标一样。
要实现这样的功能的话,需要 build 一个返回 application 的 intent ,但常见的 intent 是打开某个 activity 或者是打开某个意图( share , browser, etc...),请问一下有没有一个 intent 能够返回 application 的吗?
intent
返回
打开
activity
3 条回复
•
2017-03-20 10:25:16 +08:00
1
xingda920813
2017-03-16 16:33:21 +08:00
2
http://stackoverflow.com/questions/3356095/how-to-bring-android-existing-activity-to-front-via-notification
Sharique Abdullah 的回答.
2
twoyuan
2017-03-16 16:54:45 +08:00
一楼+1 ,创建一个和 Launcher 里入口图标相同的 intent 作为点击通知的 intent 就可以了
3
vjnjc
OP
2017-03-20 10:25:16 +08:00
@
xingda920813
多谢建议。 这个方法唯一不好的是会有界面切换的留白,其他应该都挺好用的。
关于
·
帮助文档
·
博客
·
API
·
FAQ
·
我们的愿景
·
实用小工具
·
2377 人在线
最高记录 6543
·
Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 26ms ·
UTC 11:06
·
PVG 19:06
·
LAX 04:06
·
JFK 07:06
Developed with
CodeLauncher
♥ Do have faith in what you're doing.