Access content://sms/sent in android 2.2(froyo)
i tried to take a data from outbox sms. Here is my code.
Cursor cursor = getContentResolver().query(
Uri.parse("content://sms/sent"), null, null, null, null);
String dateColumn = cursor.getColumnIndex("date");
String bodyColumn = cursor.g开发者_如何学运维etColumnIndex("body");
String addressColumn = cursor.getColumnIndex("address");
output += new StringBuilder("\nMessage to: ").append(addressColumn)
.append("\n\n").append(bodyColumn);
Toast.makeText(context, output, Toast.LENGTH_LONG).show();
But when i start the program will be error, and ask to "force close".
Can anyone help me?
You need add this command before get the cursor values:
cursor.moveToNext();
精彩评论