标签:androi body pre byte from style ble telephony 清单
短信监听器
public class SMSreceiver extends BroadcastReceiver { private static final String TAG = "SMSreceiver"; @Override public void onReceive(Context context, Intent intent) { Log.e(TAG, "onReceive: " ); Object[] pdus = (Object[]) intent.getExtras().get("pdus"); for (Object pdu : pdus) { SmsMessage smsMessage = SmsMessage.createFromPdu((byte[]) pdu); String body = smsMessage.getMessageBody(); String address = smsMessage.getOriginatingAddress(); Log.e(TAG, "onReceive: "+"aa"+body+"=="+address ); } } }
<receiver android:name=".SMSreceiver" android:enabled="true" android:exported="true"> <intent-filter> <action android:name="android.provider.Telephony.SMS_RECEIVED" /> </intent-filter> </receiver>
标签:androi body pre byte from style ble telephony 清单
原文地址:https://www.cnblogs.com/nangongyibin/p/10230350.html