【发布时间】:2014-05-15 21:16:00
【问题描述】:
我正在为我的学校开发一个紧急应用程序,我有一个问题。我有获取您坐标的代码,smsmanager 将它们发送到指定的电话号码。我试图将坐标放在谷歌地图链接中,以便收件人只需单击链接而不是将坐标输入谷歌地图,但是当我这样做时,链接被“=”、“”破坏迹象。我想知道我可以在我的代码中做些什么来使链接工作。当收件人收到消息时,它看起来像这样..
引号中的所有内容都是链接,其余的都不是。
public void onClick(View v) {
try {
txtLat = (TextView) findViewById(R.id.textview1);
String messageToSend = txtLat.getText().toString();
String number = "8143664050";
SmsManager.getDefault().sendTextMessage(number, null, messageToSend, null,null);
Toast.makeText(getApplicationContext(), "Help SMS Sent",
Toast.LENGTH_LONG).show();
} catch (Exception e) {
Toast.makeText(getApplicationContext(), "SMS failed!",
Toast.LENGTH_LONG).show();
e.printStackTrace();
}
}
});
}
}
@Override
public void onLocationChanged(Location location) {
txtLat = (TextView) findViewById(R.id.textview1);
txtLat.setText("http://maps.google.com/?q=<" + location.getLatitude() + ">,<" + location.getLongitude() + ">");
}
【问题讨论】:
标签: android gps sms location maps