|
|
|
@ -1,4 +1,4 @@
|
|
|
|
|
package com.xypower.mpapp;
|
|
|
|
|
package com.xypower.mpmaster;
|
|
|
|
|
|
|
|
|
|
import android.content.BroadcastReceiver;
|
|
|
|
|
import android.content.Context;
|
|
|
|
@ -18,6 +18,7 @@ import java.util.TimeZone;
|
|
|
|
|
*/
|
|
|
|
|
public class SmsReceiver extends BroadcastReceiver {
|
|
|
|
|
|
|
|
|
|
private static final String TAG = "MPLOG";
|
|
|
|
|
private Context mContext;
|
|
|
|
|
public static final String SMS_RECEIVED_ACTION = "android.provider.Telephony.SMS_RECEIVED";
|
|
|
|
|
public static final String SMS_DELIVER_ACTION = "android.provider.Telephony.SMS_DELIVER";
|
|
|
|
@ -26,11 +27,11 @@ public class SmsReceiver extends BroadcastReceiver {
|
|
|
|
|
public void onReceive(Context context, Intent intent) {
|
|
|
|
|
this.mContext = context;
|
|
|
|
|
|
|
|
|
|
Log.e("日志:onReceive...", "-接收短信执行了" + intent.getStringExtra("sele"));
|
|
|
|
|
Log.e(TAG, "Recv SMS");
|
|
|
|
|
String action = intent.getAction();
|
|
|
|
|
if (SMS_RECEIVED_ACTION.equals(action) || SMS_DELIVER_ACTION.equals(action)) {
|
|
|
|
|
|
|
|
|
|
Log.e("日志:onReceive。。。", "开始接收短信.....");
|
|
|
|
|
// Log.e("日志:onReceive。。。", "开始接收短信.....");
|
|
|
|
|
Bundle bundle = intent.getExtras();
|
|
|
|
|
if (bundle != null) {
|
|
|
|
|
Object[] pdus = (Object[]) bundle.get("pdus");
|
|
|
|
@ -48,6 +49,7 @@ public class SmsReceiver extends BroadcastReceiver {
|
|
|
|
|
format.setTimeZone(TimeZone.getTimeZone("GMT+08:00"));
|
|
|
|
|
String dateContent = format.format(date);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// this.abortBroadcast();// 中止
|
|
|
|
|
|
|
|
|
|
}
|