标签:
发送广播:
Intent intent = new Intent("com.rscja.cq"); sendBroadcast(intent);
AndroidManifest.xml:
<uses-permission android:name="qcom.android.receiver" /> <permission android:name="qcom.android.receiver" android:protectionLevel="normal" />
接收广播:
public class Receiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { Log.d("TAG", "receiver intent:" + intent.toString()); } }
AndroidManifest.xml:
<uses-permission android:name="qcom.android.receiver" > </uses-permission> <receiver android:name="com.example.reboot.BootReceiver" android:permission="qcom.android.receiver" > <intent-filter> <action android:name="com.rscja.cq" /> </intent-filter> </receiver>
标签:
原文地址:http://www.cnblogs.com/l2rf/p/5438129.html