我正试图补充名单上的箱子中的信息,即ok。 我想利用这一信息向清单中的新版图开放。
我的法典
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;
}
From this code I want to bring the String body and print it to a new Edittext.
The question is how can I use the body variable outsite of the getSMS()
method.
*the String
body is the body of the message.