您的位置:首页 > 移动开发 > Android开发

ANDROID之路-Android_点击Notification打开一个Activity的两种方式

2015-11-28 11:22 513 查看
/**

@作者 : 西野奈留

@博客:http://blog.csdn.net/narunishino

@声明:本文仅在【CSDN 博客】发表。

*/

点击notification打开一个activity的两种方式:

(获得PendingIntent的方式也不同)

There are two general situations:

1,Regular activity (常规Activity)

You’re starting an Activity that’s part of the application’s normal workflow.

你启动的是你application中其中一个Activity。

2,Special activity (特定Activity)

The user only sees this Activity if it’s started from a notification. In a sense, the Activity extends the notification by providing information that would be hard to display in the notification itself.

用户只能从notification中启动这个Activity(在application中不能启动这个Activity)。在某种意义上,这个Activity是notification的扩展,额外展示了一些notification本身难以展示的信息。

参考:

1,android APIs

2, http://www.haoxiqiang.info/blog/20150129-AndroidNotification.html

-End-
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息