短信与GoogleMaps链接不发送
问题描述:
我与发送短信与GoogleMaps链接工作,但在某些情况下,手机不发送,我不知道其原因,其他链接正常发送。短信与GoogleMaps链接不发送
我想解决这个问题,一些帮助。而且,重要的是,使用SMS的想法是不需要互联网。
这里是我使用的代码:
String uri = "http://maps.google.com/maps?q=" + lat + "," + lng;
if (!preferences.getNumber(activity).equals("")) {
smsBody.append(Uri.parse(uri));
String phone1 = preferences.getNumber(activity);
try {
smsManager.sendTextMessage(phone1, null, msgASerEnviada, null, null);
smsManager.sendTextMessage(phone1, null, smsBody.toString(), null, null);//mensagem com o link
Toast.makeText(activity, "Sent to " + phone1, Toast.LENGTH_SHORT).show();
} catch (Exception e) {
e.printStackTrace();
Toast.makeText(activity, "Something wrong", Toast.LENGTH_SHORT);
}
}
答
通过删除HTTP解析://