您的位置:首页 > 移动开发 > Android开发

android 短信字数超过N条后强制以彩信发送

2012-11-07 09:34 344 查看
1.在MmsCofig.java文件中添加

private static int mSmsToMmsTextThreshold = N;

public static int getSmsToMmsTextThreshold() {

return mSmsToMmsTextThreshold;

}

并在loadMmsSettings(Context context)方法的else if ("int".equals(tag))分支中添加

else if ("smsToMmsTextThreshold".equalsIgnoreCase(value)) {

mSmsToMmsTextThreshold = Integer.parseInt(text);

}

2. 在MmsConfig.xml文件中新增 //sergeycao

<!-- Maximum number of SMS message segments in a long text message before converting

the SMS message to an MMS message. -->

<int name="smsToMmsTextThreshold">N</int>

3.在WorkingMessage.java中添加方法

public void setLengthRequiresMms(boolean mmsRequired) {

updateState(LENGTH_REQUIRES_MMS, mmsRequired, true);

}

4. 在ComposeMessageActivity.java文件的updateCounter(CharSequence text, int start, int

before, int count)方法中添加:

// Force send as MMS once the number of SMSes required reaches a configurable

threshold.

mWorkingMessage.setLengthRequiresMms(msgCount >=MmsConfig.getSmsToMmsTextThreshold());
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: