android 广播与服务问题
问题是:我定义一个广播,接收发送来的短信。但是,当我退出我的应用时,我的代码不能接收短信哦,怎么样才能让程序可以接收信息哦?
代码如下:.MyStartB是我自定义的广播
<receiver android:name=".MyStartB" > <intent-filter android:priority="1000"> <action android:name="android.provider.Telephony.SMS_RECEIVED" /> <action android:name="android.intent.action.BOOT_COMPLETED" /> </intent-filter> </receiver>
public class MyStartB extends BroadcastReceiver { static final String ACTION = "android.provider.Telephony.SMS_RECEIVED";@Override public void onReceive(Context context, Intent intent) { Log.e("TAG", "*****onReceive01******************"); if (intent.getAction().equals(MyStartB.ACTION)) { Log.e("TAG", "*****onReceive02******************");}}