처리되지 않은 예외 유형 내가 할 무엇인지 확실하지 않다거나 무엇을 의미하는지 전에이 오류를받은 적이없는 오류
:처리되지 않은 예외 유형
OperationApplicationException
그것은이 코드에서 발생
public void putSettings(SharedPreferences pref){
ArrayList<ContentProviderOperation> ops =
new ArrayList<ContentProviderOperation>();
ops.add(ContentProviderOperation.newUpdate(Data.CONTENT_URI)
.withSelection(Data.RAW_CONTACT_ID + "=?", new String[]{String.valueOf(pref.getString(SmsPrefs.ID, ""))})
.withValue(Data.MIMETYPE,"vnd.android.cursor.item/color")
.withValue("data1",nColor).build());
getContentResolver().applyBatch(ContactsContract.AUTHORITY, ops); //error
ops.add(ContentProviderOperation.newUpdate(Data.CONTENT_URI)
.withSelection(Data.RAW_CONTACT_ID + "=?", new String[]{String.valueOf(pref.getString(SmsPrefs.ID, ""))})
.withValue(Data.MIMETYPE,"vnd.android.cursor.item/vibrate")
.withValue("data1", nVibrate).build());
getContentResolver().applyBatch(ContactsContract.AUTHORITY, ops); //error
ops.add(ContentProviderOperation.newUpdate(Data.CONTENT_URI)
.withSelection(Data.RAW_CONTACT_ID + "=?", new String[]{String.valueOf(pref.getString(SmsPrefs.ID, ""))})
.withValue(Data.MIMETYPE, "vnd.android.cursor.item/sound")
.withValue("data1", ringTonePath).build());
getContentResolver().applyBatch(ContactsContract.AUTHORITY, ops);//error
}
"add throws declaration"및 "try/catch with surround"옵션을 제공합니다.
내가해야 할 일과 그 이유는 무엇입니까?
어떤 라인에 표시됩니까? 연락처 조작에 대한 제약 조건을 위반하고 있습니다. – Reno