Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/apache-kafka/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 我不能启动我的接收器_Android_Broadcastreceiver - Fatal编程技术网

Android 我不能启动我的接收器

Android 我不能启动我的接收器,android,broadcastreceiver,Android,Broadcastreceiver,我从未接触过收靴器?? 在我的清单中,我有: <receiver android:name=".app.service.receiver.BootReceiver" android:enabled="true"> <intent-filter> <action android:name="android.intent.action.BOOT_COMPLETED" /> &

我从未接触过收靴器?? 在我的清单中,我有:

 <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>
您是否在清单文件中包含该权限

更新:
发现了一些东西。您应该能够将服务定义为MAIN和LAUNCHER,两者似乎都是必需的。我也不知道。

我看不出还有什么地方可能出错。是听筒没有被呼叫还是服务没有被呼叫?也许可以尝试类似的方法:Log.d(“bootceiver”,“started…”);在onReceive().nope中,不注销enything,不转到Log.d(..)上的断点;如果问题没有解决,你为什么要将其标记为已解决?只有少数人会看一看已经回答的问题。你使用的是什么android版本?如果您使用的是3.1+,您可能需要检查以下内容:
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);
}
}