【发布时间】:2012-02-27 12:05:20
【问题描述】:
Context.startService
Intent intent = new Intent(context, MyService.class);
context.startService(intent);
PendingIntent.getService
Intent intent = new Intent(context, MyService.class);
PendingIntent pi = PendingIntent.getService(context, 0, intent, 0);
pi.send();
问题
- 什么时候用 Context.startService 和 PendingIntent 启动服务?
- 为什么要使用一个而不是另一个?
【问题讨论】:
标签: android android-intent android-context android-pendingintent