我需要一些帮助从SMS消息中获取文本。当我在设备上收到带有字符串"GPS location: http://maps.google.com/maps?q=-6.97425,107.63164"
的短信时,我想检索应用程序的链接。除了检查if (text starts with "GPS location:")
之外,我不知道如何做到这一点:
for (SmsMessage message : msgs) {
String msg = message.getMessageBody();
if (msg.startsWith("GPS location")){
//how to get the link???
}
提前致谢!