扫二维码与项目经理沟通
我们在微信上24小时期待你的声音
解答本文疑问/技术咨询/运营咨询/技术建议/互联网交流
package com.pzq.test.zhuanpan4; import android.app.Activity; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.os.Handler; import android.telephony.SmsMessage; import android.text.TextUtils; import android.util.Log; import java.util.regex.Matcher; import java.util.regex.Pattern; /** * Created by asus on 2016/6/26. */ public class SMSUtils { private BroadcastReceiver smsReceiver, codeReceiver; private IntentFilter filter, mIntentFilter; private Handler handler; private String strContent; private String patternCoder = "(? * * registerReceiver(); u = new SMSUtils(MainActivity.this); * private void registerReceiver() { IntentFilter intentFilter = new IntentFilter(); intentFilter.addAction(SMSUtils.MSMCode_CHANGE_BROADCAST); registerReceiver(new SMSBroadcastReceiver(), intentFilter); } class SMSBroadcastReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { if (intent.getAction() == SMSUtils.MSMCode_CHANGE_BROADCAST) { Bundle bundle = intent.getExtras(); smScode = bundle.getString("code"); Log.d("mainpzqtest....", "mBroadcastReceiver...." + smScode); et.setText(smScode); } } }; * * */ }
我们在微信上24小时期待你的声音
解答本文疑问/技术咨询/运营咨询/技术建议/互联网交流