[英]How to pass text to Google Voice SMS Programmatically?
I use the following code to start the SMS application:
Intent smsIntent=new Intent(Intent.ACTION_SENDTO, Uri.parse("sms:"));
smsIntent.putExtra("sms_body", "Message Body");
startActivity(smsIntent);
It works fine if user selects standard "Messaging" application. 如果用户选择标准的“消息”应用程序,它工作正常。 But if user selects GV the message body text is ignored. 但是如果用户选择GV,则忽略消息正文。
I have also tried the following as suggested in some forums: 我也在一些论坛中尝试了以下建议:
smsIntent.putExtra(Intent.EXTRA_TEXT, "Message Body"); smsIntent.putExtra(Intent.EXTRA_TEXT,“Message Body”);
I have searched all the forums I know of and tried lot of things. 我搜索了所有我认识的论坛,并尝试了很多东西。 Nothing worked for me. 没有什么对我有用。 Am I missing something here? 我在这里错过了什么吗? Does GV need a special handing that it can't be treated as regular “Messaging” app? GV是否需要特殊处理才能将其视为常规“消息”应用程序?
Here are some thoughts that might point you in the right direction: 以下是一些可能指向正确方向的想法:
what is the difference between ACTION_SENDTO and ACTION_VIEW when sending sms? 发送短信时ACTION_SENDTO和ACTION_VIEW有什么区别?
Here's a third party library for accessing Google Voice: http://code.google.com/p/google-voice-java/ ...except it directly accesses Google Voice via its web URLs... 以下是访问Google语音的第三方库: http : //code.google.com/p/google-voice-java/ ...除了通过其网址直接访问Google语音...
Here's some old (2010) Android MMS source where they manually accessed Google Voice, which might give some bonus hints: 这是一些旧的(2010)Android彩信来源,他们手动访问谷歌语音,这可能会提供一些奖励提示:
Also try putting it in an extra called "data"
or "pdudata"
还可以尝试将其添加到一个额外的"data"
或"pdudata"
Also, here's some more (old?) source mentioning some intent extras including "android.mms.extra.MESSAGE"
此外, 这里的一些(旧?)源提一些额外的意图,包括"android.mms.extra.MESSAGE"
Hopefully one of these help you out... 希望其中一个可以帮助你...
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.