0

i am trying to separate the SMS thread so that i can easily get the most recent text message thread looks like this :

SMSThread [id=9ccf49ec18f8f2b46e9aadbf2d07d1c57f162bd5, title=, date=Sun Mar 17 16:19:23 EDT 2013, contact={id=;name=Taylor;number=+1phonenumber;imageUrl=http://www.google.com/voice/resources/1366864992-blue_ghost.jpg;}, read=false, starred=false, listSms=[

SMS [dateTime=Sun Mar 17 16:19:00 EDT 2013, from={id=;name=Contact;number=+1Phonenumber;imageUrl=http://www.google.com/voice/resources/1366864992-blue_ghost.jpg;}, text=sup??],

the way im doing it works but when someone texts me a comma or bracket it only separates certain parts... is there a better way to parse it less sloppily

Ryan Maddox
  • 312
  • 1
  • 5
  • 15

1 Answers1

0

well instead of parsing all of the threads you could use the get all SMS methods, if you want to get the most recent text you could do this :

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

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

then just us the methods in the SMS class to get the needed information

Ryan Maddox
  • 312
  • 1
  • 5
  • 15