Android 70??????????????
???????????? ???????[ 2013/4/12 10:17:06 ] ????????????
????46. ?????м?????????Щ????к???????????Android?????????????? Android??????(?????????)
??????android?£?????????????????????????????????????????????????????BroadcastReceiver???????????????????????и????????????????????????дBroadcastReceiver?????onReceiver?????????????????????????????????????????????????????????????????????????????
????public class SmsBroadCastReceiverextends BroadcastReceiver
????{
????@Override
????public void onReceive(Context context?? Intent intent)
????{
????Bundle bundle = intent.getExtras();
????Object[] object = (Object[])bundle.get("pdus");
????SmsMessage sms[]=new SmsMessage[object.length];
????for(int i=0;i
????{
????sms[0] =SmsMessage.createFromPdu((byte[])object);
????Toast.makeText(context?? "????"+sms.getDisplayOriginatingAddress()+"????????"+sms.getDisplayMessageBody()??Toast.LENGTH_SHORT).show();
????}
????//??????????????????????????????????????????????????????????
????abortBroadcast();
????}
????}
??????????????????????????ù?????????????????????????????????android.provider.Telephony.SMS_RECEIVED
???????????????????????????棬????????????????и??????????????????????????????????
????//?????????
????smsBroadCastReceiver = newSmsBroadCastReceiver();
????//????????????????????????
????IntentFilter intentFilter = newIntentFilter("android.provider.Telephony.SMS_RECEIVED");
????//????
????BroadCastReceiverActivity.this.registerReceiver(smsBroadCastReceiver??intentFilter);
???????????AndroidManifest.xml?????ù?
????package="spl.broadCastReceiver"
????android:versionCode="1"
????android:versionName="1.0">
????android:label="@string/app_name">
???????????????????????
????1)??????????????????????????????????????
????2)????????????????????ó???????????????????????????????????????С?
????47. ??????????????????Message??Handler??MessageQueue??Looper????????Handler??飺
???????Handler????????????Message??Runable??????Щ????????????MessageQueue????????????????????????????????????????MessageQueue?????????????????μ?Handler??????????????????????????????????????????????????MessageQueue?????????????????Handler??Message??Runable???????MessageQueue??????????Щ??????MessageQueue???Handler????????????
????Handler????????????????(1)????????????????????????????ЩMessage??Runnable????(2)?????????(????Handler?????)???????Щ???е??????
????Scheduling Message????(1)????????????·???????
????post(Runnable):Runnable??handler???????????У?????????????????
????postAtTime(Runnable??long):
????postDelayed(Runnable??long):
????sendEmptyMessage(int):
????sendMessage(Message):
????sendMessageAtTime(Message??long):
????sendMessageDelayed(Message??long):
????post????????????Runnable????????MessageQueue??MessageQueue?????Щ??????????????????????????????sendMessage??????????????Message?????????У???ЩMessage????????Щ?????Handler??hanlerMessage(Message)??????ЩMessage.?????handlerMessage(Message)??????Handler??????????д?????????????????????
??????posting????sending?????Hanler?????????????????????MessageQueue??????????????????????????????????????????????????????????timeout??tick????????????????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11