如何启动广播接收器应用程序在Android中启动?

时间:2015-11-18 05:56:56

标签: android

  <receiver
    android:name="com.orcatracker.functions.BootService">
    <intent-filter >
        <action
            android:name="android.intent.action.BOOT_COMPLETED">
        </action>
    </intent-filter>
    </receiver>

如何在应用启动时启动接收器?我在manifest.xml中使用了以下权限

<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>

1 个答案:

答案 0 :(得分:-1)

以下代码用于调用BROADDCAST RECEIVER:

 Intent intent = new Intent(this,BootCompletedIntentReceiver.class);
 sendBroadcast(intent);// this line is use to start broadcast.