使用Google Voice Java api解析SMSThread

使用Google Voice Java api解析SMSThread,java,parsing,google-voice,Java,Parsing,Google Voice,我正在尝试分离的短信线程,以便我可以很容易地得到最新的短信 线程如下所示: SMS[日期时间=2013年3月17日星期日16:19:00美国东部夏令时,发件人={id=;姓名=联系人;号码=+1电话号码;图像URL=;},文本=支持??] 我这样做的方式工作,但当有人给我发短信逗号或括号,它只分开某些部分。。。有没有更好的方法来解析它,而不是解析所有的线程?你可以使用get all SMS方法,如果你想获取最新的文本,你可以这样做: Collection<SMSThread> sms

我正在尝试分离的短信线程,以便我可以很容易地得到最新的短信 线程如下所示:

SMS[日期时间=2013年3月17日星期日16:19:00美国东部夏令时,发件人={id=;姓名=联系人;号码=+1电话号码;图像URL=;},文本=支持??]


我这样做的方式工作,但当有人给我发短信逗号或括号,它只分开某些部分。。。有没有更好的方法来解析它,而不是解析所有的线程?你可以使用get all SMS方法,如果你想获取最新的文本,你可以这样做:

Collection<SMSThread> smsthreads = v.getSMSThreads();

        SMSThread f = smsthreads.iterator().next();
        Collection<SMS> sms = f.getAllSMS();
        SMS mostrecentsms = sms.iterator().next();
Collection-smsthreads=v.getSMSThreads();
SMSThread f=smsthreads.iterator().next();
集合sms=f.getAllSMS();
SMS mostrecentsms=SMS.iterator().next();

然后,只需使用SMS类中的方法即可获得所需信息

谢谢!我想弄清楚这件事已经有一段时间了
Collection<SMSThread> smsthreads = v.getSMSThreads();

        SMSThread f = smsthreads.iterator().next();
        Collection<SMS> sms = f.getAllSMS();
        SMS mostrecentsms = sms.iterator().next();