0
在启动时启动服务的代码.....我甚至包括清单文件的权限,如前所述...但服务不启动...我必须通过startService(Intent ..)命令明确地开始...我在做什么时有任何错误?无法启动整个应用程序的引导加载活动
public class BootReceiver extends BroadcastReceiver{
@Override
public void onReceive(Context context, Intent arg1) {
Intent serviceIntent = new Intent(BackgroundService.class.getName());
context.startService(serviceIntent);
}
}
<receiver android:name="BootReceiver">
<intent-filter>
<action
android:name="android.intent.action.BOOT_COMPLETED">
</action>
</intent-filter>
</receiver>
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
即使这对我也不适用....清单中应用程序节点外部的 ... –
2011-04-02 05:34:35
当我这样做,服务应该开始在应用程序加载权... – 2011-04-02 05:35:10
仔细检查你的代码和清单。也看看这个问题:http://stackoverflow.com/questions/1056570/how-to-autostart-an-android-application – Olegas 2011-04-03 18:47:44