我正在使用Firebase,正在尝试使用下面的send message方法将一些数据发送到数据库。打电话给我
!!!绑定交易失败!!! (包裹大小= 2585116)。
private void sendMessage() {
String message = typeMessage.getText().toString();
if (!TextUtils.isEmpty(message)){
String current_user_ref = "messages/" + mCurrentUserId + "/" +mChatUser;
String chat_user_ref = "messages/" + mChatUser + "/" + mCurrentUserId;
DatabaseReference user_message_push = mRootRef.child("messages").child(mCurrentUserId).child(mChatUser).push();
String push_id = user_message_push.getKey();
Map messageMap = new HashMap();
messageMap.put("message",message);
messageMap.put("seen",false);
messageMap.put("type","text");
messageMap.put("time",ServerValue.TIMESTAMP);
Map messageUserMap = new HashMap();
messageUserMap.put(current_user_ref + "/" + push_id, messageMap);
messageMap.put(chat_user_ref + "/" + push_id,messageMap);
mRootRef.updateChildren(messageUserMap, new DatabaseReference.CompletionListener() {
@Override
public void onComplete(@Nullable DatabaseError databaseError, @NonNull DatabaseReference databaseReference) {
if (databaseError !=null){
Log.d("CHAT App",databaseError.getMessage().toString());
}
}
});
}
}
这是我的logcat的错误部分。
12-27 12:43:05.667 16615-16615/com.myApp.myApp E/JavaBinder: !!! FAILED BINDER TRANSACTION !!! (parcel size = 2585116)
12-27 12:43:05.672 16615-16615/com.myApp.myApp E/AndroidRuntime: Error reporting crash
android.os.TransactionTooLargeException: data parcel size 2585116 bytes
at android.os.BinderProxy.transactNative(Native Method)
at android.os.BinderProxy.transact(Binder.java:503)
at android.app.ActivityManagerProxy.handleApplicationCrash(ActivityManagerNative.java:4425)
at com.android.internal.os.RuntimeInit$UncaughtHandler.uncaughtException(RuntimeInit.java:90)
at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:693)
at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:690)
12-27 12:43:05.755 1653-1715/system_process E/InputDispatcher: channel 'cff7e18 com.myApp.myApp/com.myApp.myApp.BottomNav (server)' ~ Channel is unrecoverably broken and will be disposed!
该如何解决?