Android 谷歌地图链接被符号破坏

Android 谷歌地图链接被符号破坏,android,gps,sms,location,maps,Android,Gps,Sms,Location,Maps,我正在为我的学校开发一个紧急应用程序,我有一个问题。我有获取你坐标的代码,smsmanager会将它们发送到指定的电话号码。我试着把坐标放在谷歌地图的链接中,这样接收者就可以点击一个链接,而不是把坐标输入谷歌地图,但是当我这样做时,链接被“=”,“”符号打断。我想知道我能在我的代码中做些什么来让链接工作。当收件人收到消息时,看起来是这样的 “=” 引文中的所有内容都是链接,其余的则不是 public void onClick(View v) { try {

我正在为我的学校开发一个紧急应用程序,我有一个问题。我有获取你坐标的代码,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() + ">");

}
public void onClick(视图v){
试一试{
txtLat=(TextView)findViewById(R.id.textview1);
字符串messageToSend=txtLat.getText().toString();
字符串编号=“8143664050”;
SmsManager.getDefault().sendTextMessage(number,null,messageToSend,null,null);
Toast.makeText(getApplicationContext(),“已发送帮助短信”,
Toast.LENGTH_LONG).show();
}捕获(例外e){
Toast.makeText(getApplicationContext(),“SMS失败!”,
Toast.LENGTH_LONG).show();
e、 printStackTrace();
}
}
});
}
}
@凌驾
已更改位置上的公共无效(位置){
txtLat=(TextView)findViewById(R.id.textview1);
txtLat.setText(“http://maps.google.com/?q=,");
}
试试:

对于三维/卫星地图:

txtLat.setText(
        "https://www.google.com/maps/@" + location.getLatitude() + "," + 
        location.getLongitude() + ",15000m/data=!3m1!1e3");

当你使用谷歌地图时,地址应该会自动更新,试试看它是如何变化的。

还有一个小问题。。例如,有没有办法从这里将地图类型更改为卫星地图?
txtLat.setText(
        "https://www.google.com/maps/@" + location.getLatitude() + "," + 
        location.getLongitude() + ",15000m/data=!3m1!1e3");