Does startService() create a new Service instance or using the existing one?
For example, in the following code, does it create two UpdateService instances or just one UpdateService instance?
Thanks.
int[] appWidgetIds = new int[] {1, 2};
for (int appWidgetId : appWidgetIds) {
Intent intent = new Intent(context, UpdateService.class);
intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId);
context.startService(intent);
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…