当前位置: 代码迷 >> 综合 >> android 短信字数超过N条后强制以彩信发送
  详细解决方案

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

热度:6   发布时间:2024-01-19 20:12:53.0
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());
  相关解决方案