<div class="dp-highlighter bg_html"><div class="bar"><div class="tools"><b>[html]</b> <a href="#" class="ViewSource" title="view plain" onclick="dp.sh.Toolbar.Command('ViewSource',this);return false;">view plain</a><a href="#" class="CopyToClipboard" title="copy" onclick="dp.sh.Toolbar.Command('CopyToClipboard',this);return false;">copy</a><a href="#" class="PrintSource" title="print" onclick="dp.sh.Toolbar.Command('PrintSource',this);return false;">print</a><a href="#" class="About" title="?" onclick="dp.sh.Toolbar.Command('About',this);return false;">?</a><div style="position: absolute; left: 0px; top: 0px; width: 0px; height: 0px; z-index: 99; "><embed id="ZeroClipboardMovie_2" src="http://static.blog.csdn.net/scripts/ZeroClipboard/ZeroClipboard.swf" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="0" height="0" name="ZeroClipboardMovie_2" align="middle" allowscriptaccess="always" allowfullscreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="id=2&width=0&height=0" wmode="transparent"></div></div></div><ol start="1" class="dp-xml"><li class="alt"><span><span> </span><span class="tag"><</span><span class="tag-name">pre</span><span> </span><span class="attribute">name</span><span>=</span><span class="attribute-value">"code"</span><span> </span><span class="attribute">class</span><span>=</span><span class="attribute-value">"java"</span><span class="tag">></span><span>PendingIntent </span><span class="attribute">sentIntent</span><span> = </span><span class="attribute-value">PendingIntent</span><span>.getBroadcast(getApplicationContext(), 0, new Intent(SENT_SMS_ACTION), 0); </span></span></li><li class=""><span> manager.sendTextMessage(num, null, content, sentIntent, null);//判斷是否發送成功<span class="tag"></</span><span class="tag-name">pre</span><span class="tag">></span><span class="tag"><</span><span class="tag-name">br</span><span class="tag">></span><span> </span></span></li><li class="alt"><span><span class="tag"><</span><span class="tag-name">pre</span><span class="tag">></span><span class="tag"></</span><span class="tag-name">pre</span><span class="tag">></span><span> </span></span></li><li class=""><span><span class="tag"><</span><span class="tag-name">pre</span><span class="tag">></span><span class="tag"></</span><span class="tag-name">pre</span><span class="tag">></span><span> </span></span></li><li class="alt"><span><span class="tag"><</span><span class="tag-name">pre</span><span> </span><span class="attribute">name</span><span>=</span><span class="attribute-value">"code"</span><span> </span><span class="attribute">class</span><span>=</span><span class="attribute-value">"html"</span><span class="tag">></span><span> </span><span class="tag"><</span><span class="tag-name">receiver</span><span> </span><span class="attribute">android:name</span><span>=</span><span class="attribute-value">".AutoSendMessageBroadcastReceiver"</span><span class="tag">></span><span> </span></span></li><li class=""><span> <span class="tag"><</span><span class="tag-name">intent-filter</span><span> </span><span class="attribute">android:priority</span><span>=</span><span class="attribute-value">"1000"</span><span class="tag">></span><span> </span></span></li><li class="alt"><span> <span class="tag"><</span><span class="tag-name">action</span><span> </span><span class="attribute">android:name</span><span>=</span><span class="attribute-value">"android.intent.action.SENT_SMS_ACTION"</span><span class="tag">/></span><span> </span></span></li><li class=""><span> <span class="tag"></</span><span class="tag-name">intent-filter</span><span class="tag">></span><span> </span></span></li><li class="alt"><span> <span class="tag"></</span><span class="tag-name">receiver</span><span class="tag">></span><span> </span></span></li><li class=""><span><span class="tag"></</span><span class="tag-name">pre</span><span class="tag">></span><span class="tag"><</span><span class="tag-name">br</span><span class="tag">></span><span> </span></span></li><li class="alt"><span><span class="tag"><</span><span class="tag-name">pre</span><span> </span><span class="attribute">name</span><span>=</span><span class="attribute-value">"code"</span><span> </span><span class="attribute">class</span><span>=</span><span class="attribute-value">"java"</span><span class="tag">></span><span>public class AutoSendMessageBroadcastReceiver extends BroadcastReceiver { </span></span>
</li><li class=""><span> </span></li><li class="alt"><span> @Override </span></li><li class=""><span> public void onReceive(Context context, Intent intent) { </span></li>&