SmsReplyReceiver.java 文件源码

java
阅读 27 收藏 0 点赞 0 评论 0

项目:sagesmobile-mReceive 作者:
@Override
public void onReceive(Context context, Intent intent) {
    SmsManager smgr = SmsManager.getDefault();
    Bundle extras = intent.getExtras();
    if (extras != null) {
        if (extras.containsKey(KEY_DESTINATION_PHONE) && extras.containsKey(KEY_MESSAGE)) {
            String destinationAddr = extras.getString(KEY_DESTINATION_PHONE);
            String mesg = extras.getString(KEY_MESSAGE);
            /** TODO if mesg.length > 160(i think?) chars then this throws exception. would need
             * to use the version that sends segmented sms **/
            smgr.sendTextMessage(destinationAddr, null, mesg, null, null);
        }
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号