我正在此錯誤一類(JAVA):拋出:IllegalArgumentException從延伸RealmObject
IllegalArgumentException
在執行以下方法。我不知道爲什麼會發生。
任何想法最新怎麼了?
public void sendNoteWithoutImage(){
Toast.makeText(getContext(), "Step 1", Toast.LENGTH_LONG).show();
// saving objects
Note notesRealmClass = new Note();
notesRealmClass.setTitle(titleStr);
Toast.makeText(getContext(), "Step 2", Toast.LENGTH_LONG).show();
ChannelIDs = TextUtils.join(" ",selectedItems);
Toast.makeText(getContext(), "Step 3", Toast.LENGTH_LONG).show();
notesRealmClass.setObjId(objId);
Toast.makeText(getContext(), "Step 4", Toast.LENGTH_LONG).show();
// save object asynchronously
Backendless.Persistence.save(notesRealmClass, new AsyncCallback<Note>() {
public void handleResponse(Note note) {
Toast.makeText(getContext(), "Step 5", Toast.LENGTH_LONG).show();
// new Contact instance has been saved
Toast.makeText(getActivity(), "Successfully posted ", Toast.LENGTH_SHORT).show();
}
public void handleFault(BackendlessFault fault) {
Toast.makeText(getContext(), "Step 6", Toast.LENGTH_LONG).show();
Log.d("ERROR : ", "" + fault.getMessage());
Log.d("ERROR Code: ",""+fault.getCode());
Toast.makeText(getActivity(), "" + fault.getMessage(), Toast.LENGTH_SHORT).show();
// an error has occurred, the error code can be retrieved with fault.getCode()
}
});}
正如你所看到的,我把編號敬酒來檢查代碼的哪個部分正在執行。從步驟1到4,一切都很好,但不是在第5步我直接在第6步得到一個錯誤和錯誤的打印是:建立內部的AsyncCallback你敬酒時
02-18 12:54:09.025 25161-25161/pb.package D/ERROR :: rx/Observable 02-18 12:54:09.025 25161-25161/pb.package D/ERROR Code:: IllegalArgumentException
請提供該拋出異常的代碼行。 –
我認爲它已經在那裏球員看到'Backendless.Persistence.save(notesRealmClass,新AsyncCallback()....'這條線 –
@Rami你是什麼意思由AsyncCallBack我沒有得到它,也許這是我的asynccallback類' Backendless.Persistence.save(notesRealmClass,new AsyncCallback()' –