我从联系人中获取不同的号码并将它们传递到短信应用程序。我正在使用以下内容:
Intent intent = new Intent( Intent.ACTION_VIEW, Uri.parse( "sms:"+numbers) ); //numbers separated with ;
intent.putExtra( "sms_body", body );
startActivity( intent );
问题是如果我用 '; 分隔数字',它不适用于 Galaxy S,但适用于 HTC、Samsung Gio 等其他设备...在 Galaxy S 上,如果我用逗号“,”分隔数字,它就可以工作。那么如何解决这个问题呢?
通常使用分号 (';') 是分隔电话号码的正确选择。所以你应该使用这个。例如,可能是由于供应商特定调整或自定义供应商应用程序而无法在 Galaxy S 上运行。
我建议除了三星设备之外,在所有地方都使用分号。不幸的是,您必须在源代码中做出这个丑陋的供应商特定决定。
String separator = "; ";
if(android.os.Build.MANUFACTURER.contains("Samsung")){
separator = ", ";
}
// set the numbers string with the use of 'separator'
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)