我永远达不到BootReceiver? 在我的表现,我有:我无法启动我的接收器
<receiver android:name=".app.service.receiver.BootReceiver" android:enabled="true">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<category android:name="android.intent.category.HOME" />
</intent-filter>
</receiver>
<service android:name=".app.service.Process">
<intent-filter>
<action android:name=".app.service.Process" />
</intent-filter>
</service>
我BootReceiver我:
package cc.com.app.service.receiver;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
public class BootReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
Intent serviceIntent = new Intent();
serviceIntent.setAction("cc.com.service.Process");
context.startService(serviceIntent);
}
}
你使用的是什么android版本?如果您使用的是3.1+,则可能需要检查以下内容:http://commonsware.com/blog/2011/07/05/boot-completed-regression.html – 2011-08-12 14:10:22