代码如下:
// 实例化过滤器并设置要过滤的广播
String filter = Intent.ACTION_TIME_CHANGED;// "android.provider.Telephony.SMS_RECEIVED"
IntentFilter intentFilter = new IntentFilter(filter );
// 注册广播
registerReceiver(timeBroadcast, intentFilter);
timeBroadcast = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
// TODO Auto-generated method stub
// show();
Log.e(TAG, "broadcast time....");
}
};
如果改成
String filter = "android.provider.Telephony.SMS_RECEIVED";
可以收到短信的广播,求指导!