vjnjc
V2EX  ›  Android

[android 开发] 求问怎么制作一个返回 application 的 notification

  •  
  •   vjnjc · Mar 16, 2017 · 13163 views
    This topic created in 3529 days ago, the information mentioned may be changed or developed.
    一直想实现一个这样的功能,点击 notification 回到程序最近一次打开的界面,就跟在手机桌面点击程序图标一样。

    要实现这样的功能的话,需要 build 一个返回 application 的 intent ,但常见的 intent 是打开某个 activity 或者是打开某个意图( share , browser, etc...),请问一下有没有一个 intent 能够返回 application 的吗?
    3 replies  •  2017-03-20 10:25:16 +08:00
    twoyuan
    twoyuan
    Mar 16, 2017
    2
    一楼+1 ,创建一个和 Launcher 里入口图标相同的 intent 作为点击通知的 intent 就可以了
    vjnjc
    vjnjc
    OP
    Mar 20, 2017
    3
    @xingda920813 多谢建议。 这个方法唯一不好的是会有界面切换的留白,其他应该都挺好用的。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1318 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 17:28 · PVG 01:28 · LAX 09:28 · JFK 12:28
    ♥ Do have faith in what you're doing.