Reputation: 1019
actually i want to delete sms from inbox as per id i am using following code
but it showing error
my code:
Uri deleteUri = Uri.parse("content://sms/");
Cursor m_cCursor=context.getContentResolver().query(deleteUri, null, null, null, null);
int m_cnum=m_cCursor.getCount();
int id =m_cCursor.getInt(0);
int thread_id = m_cCursor.getInt(1);
the error is:
0 new java.lang.RuntimeException [2]
3 dup
4 ldc <String "Stub!"> [3]
6 invokespecial java.lang.RuntimeException(java.lang.String) [4]
9 athrow
Line numbers:
[pc: 0, line: 21]
Local variable table:
[pc: 0, pc: 10] local: this index: 0 type: android.content.ContextWrapper
[pc: 0, pc: 10] local: name index: 1 type: java.lang.String
[pc: 0, pc: 10] local: mode index: 2 type: int
Upvotes: 0
Views: 2031
Reputation: 1049
After
Cursor m_cCursor=context.getContentResolver().query(deleteUri, null, null, null, null);
add
while (cur.moveToNext()) {
int m_cnum=m_cCursor.getCount();
int id =m_cCursor.getInt(0);
int thread_id = m_cCursor.getInt(1);
}
Upvotes: 0