下面是我得到的图像
这是日食问题吗?
当我们在onStart()
方法中放入任何代码时,它无法正常工作
答案 0 :(得分:1)
这是因为onStart()
已弃用,您现在可以使用onStartCommand()
请参阅此link
使用onStartCommand()
。
来自谷歌文档
// This is the old onStart method that will be called on the pre-2.0
// platform.
@Override
public void onStart(Intent intent, int startId) {
handleStart(intent, startId);
}
//On 2.0 or later we override onStartCommand() so this
// method will not be called.
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
handleStart(intent, startId);
return START_NOT_STICKY;
}