
Untitled
By: a guest on
May 7th, 2012 | syntax:
None | size: 0.85 KB | hits: 13 | expires: Never
android open message from a listview to an editext
public List<String> getSMS() {
// TODO Auto-generated method stub
List<String> sms = new ArrayList<String>();
Uri uriSMSURI = Uri.parse("content://sms/inbox");
Cursor cur = getContentResolver().query(uriSMSURI, null, null, null, null);
while (cur.moveToNext()) {
String address = cur.getString(cur.getColumnIndex("address"));
String body = cur.getString(cur.getColumnIndexOrThrow("body"));
sms.add("Number: " + address + " .Message: " + body);
}
return sms;
}
public class Message {
private String address;
private String body;
public Message( String address, String body ) {
this.address = address;
this.body = body;
}
public String getAddress() {
return address;
}
public String getBody() {
return body;
}