http://www.helloandroid.com/files/xmaswidget/android_howto-hellowidget.pdf
但是,如果我试图用服务(该教程中的第二种方式)启动示例,我在DDMS的LogCat中得到了以下错误消息:
WARN/ActivityManager(52): Unable to start service Intent { cmp=de.tlindig.android/.HelloWidget$UpdateService }: not found
我不明白的是,包名后面的斜杠(“/”)来自哪里。
@Override
public void onUpdate(上下文上下文,AppWidgetManager AppWidgetManager,
int[]appWidgetIds){
Log.d("HelloWidget.onUpdate", "UpdateService.class is: " + UpdateService.class);
Intent intent = new Intent(context, UpdateService.class);
context.startService(intent);
}
所以我在LogCat中得到了以下输出:
DEBUG/HelloWidget.onUpdate(320): UpdateService.class is: class de.tlindig.android.HelloWidget$UpdateService
WARN/ActivityManager(52): Unable to start service Intent { cmp=de.tlindig.android/.HelloWidget$UpdateService }: not found
有人知道我做错了什么吗?
谢谢你的帮助。