Android: java.lang.IllegalArgumentException: Bad conversation thread id: 15555215554 -



Android: java.lang.IllegalArgumentException: Bad conversation thread id: 15555215554 -

i trying delete sms messages android emulator , receiving next error:

java.lang.illegalargumentexception: bad conversation thread id: 15555215554

does have same problem , can help me resolve problem? code delete message next:

seek { final long thread_id = transactioncursor.getlong(1); uri thread = uri.parse("content://sms/conversations/" + thread_id); getcontentresolver().delete(thread, null, null); } grab (exception e) { system.out.println(e.getmessage()); }

in manifest file have added next permissions:

<uses-permission android:name="android.permission.read_sms" /> <uses-permission android:name="android.permission.write_sms" />

yes, ahmet, right , understand error message, changing code

try { final long thread_id = transactioncursor.getlong(transactioncursor.getcolumnindex("thread_id")); final uri thread = uri.parse("content://sms/conversations/" + thread_id); final int numberofdeletedmessages = getcontentresolver().delete(thread, null, null); log.v(tag, "number of deleted messages equals " + numberofdeletedmessages); } grab (exception e) { log.e(tag,e.getmessage(),e); }

and works successful.

java android sms

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -