Android的传递多个号码的短信意图 [英] Android passing multiple numbers to SMS intent
问题描述
我的联系人获得不同的号码,并将其传递给SMS应用。我现在用的是以下内容:
I am getting different numbers from Contacts and passing them to SMS application. I am using the following:
Intent intent = new Intent( Intent.ACTION_VIEW, Uri.parse( "sms:"+numbers) ); //numbers separated with ;
intent.putExtra( "sms_body", body );
startActivity( intent );
现在的问题是,如果我单独的数字与'; ',它不会在Galaxy S的工作,但工作在其他如HTC,三星吉奥等等......在银河S,它的工作原理,如果我单独的数字与逗号,。那么如何解决这个问题呢?
The problem is if I separate numbers with ' ; ', it does not work on Galaxy S but works on others like HTC, Samsung Gio etc... On Galaxy S, it works if I separate numbers with comma ' , '. So how to resolve this issue?
推荐答案
通常使用分号(';')是正确的选择来分隔电话号码。所以,你应该用这个。这可能是由于供应商的具体调整或定制的供应商应用程序,它并没有在Galaxy S的工作,例如。
Normally using a semicolon (';') is the right choice to separate phone numbers. So you should use this. It might be due to vendor specific adjustments or custom vendor applications that it does not work on Galaxy S for example.
我会propse到处使用分号除了三星设备。不幸的是,你必须在你的源$ C $ C做这个丑陋的特定于供应商的决定。
I would propse to use semicolon everywhere except for Samsung devices. You unfortunately have to do this ugly vendor specific decision within your source code.
String separator = "; ";
if(android.os.Build.MANUFACTURER.contains("Samsung")){
separator = ", ";
}
// set the numbers string with the use of 'separator'
这篇关于Android的传递多个号码的短信意图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!