有人可以帮我理解" 未决意图 "吗?一些例子也会有所帮助.
我用Google搜索并发现了一些信息,但我仍然无法理解它.
NotificationManager notificationManager;
PendingIntent pendingIntent;
Updater() {
notificationManager = (NotificationManager) UpdaterService.this
.getSystemService(Context.NOTIFICATION_SERVICE);
notification = new Notification( android.R.drawable.stat_sys_download,
"MyTwitter", System.currentTimeMillis());
pendingIntent = PendingIntent.getActivity(UpdaterService.this, 0,
new Intent(UpdaterService.this, Timeline.class), 0);
}
Run Code Online (Sandbox Code Playgroud)
挂起的意图,就像描述一个Intent供以后使用.实际上,就像有一个食谱可以再次制造相同的意图一样.
对于AlarmManager,这意味着它可以将PendingIntent存储在其他地方,只需在需要时创建Intent.这也意味着Intent可以轻松重复.
(据我所知,如果我错了,任何人都会纠正我)
| 归档时间: |
|
| 查看次数: |
1136 次 |
| 最近记录: |