我有一种方法可以返回GPS当前位置的经度和纬度。我想将这些值存储在公共变量中,以便我可以从另一个静态类访问它们,它的任务是发送带有经度和纬度信息的短信。将方法结果变量转换为另一个类
我有这样的代码中的主要活动:
location.getLatitude();
location.getLongitude();
strLongitude = location.convert(location.getLongitude(), location.FORMAT_DEGREES);
strLatitude = location.convert(location.getLatitude(), location.FORMAT_DEGREES);
在其他静态类:
SmsManager smsManager = SmsManager.getDefault();
// Send a text based SMS
smsManager.sendTextMessage(senderNum,null,"Latitude and Longitude", null,null);
请显示您的代码[mcve]。 6行代码不完整。 –