环信easeui已发送消息就崩,空指针

FATAL EXCEPTION: main
  java.lang.NullPointerException
    at com.hyphenate.easeui.model.EasePreferenceManager.<init>(EasePreferenceManager.java:16)
    at com.hyphenate.easeui.model.EasePreferenceManager.getInstance(EasePreferenceManager.java:23)
    at com.hyphenate.easeui.model.EaseAtMessageHelper.<init>(EaseAtMessageHelper.java:34)
    at com.hyphenate.easeui.model.EaseAtMessageHelper.get(EaseAtMessageHelper.java:27)
    at com.hyphenate.easeui.ui.EaseChatFragment.sendTextMessage(EaseChatFragment.java:663)
    at com.hyphenate.easeui.ui.EaseChatFragment$1.onSendMessage(EaseChatFragment.java:153)
    at com.hyphenate.easeui.widget.EaseChatInputMenu$1.onSendBtnClicked(EaseChatInputMenu.java:184)
    at com.hyphenate.easeui.widget.EaseChatPrimaryMenu.onClick(EaseChatPrimaryMenu.java:161)
    at android.view.View.performClick(View.java:4299)
    at android.view.View$PerformClick.run(View.java:17576)
    at android.os.Handler.handleCallback(Handler.java:725)
    at android.os.Handler.dispatchMessage(Handler.java:92)
    at android.os.Looper.loop(Looper.java:153)
    at android.app.ActivityThread.main(ActivityThread.java:5383)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:511)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:853)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620)
    at dalvik.system.NativeStart.main(Native Method)
已邀请:

张行长

赞同来自:

一发送消息就崩,报的空指针的类都是easeui中的,我都没改过;按照官网的写的

//new出EaseChatFragment或其子类的实例
 EaseChatFragment chatFragment = new EaseChatFragment();
//传入参数
 Bundle args = new Bundle();
 args.putInt(EaseConstant.EXTRA_CHAT_TYPE, EaseConstant.CHATTYPE_SINGLE);
 args.putString(EaseConstant.EXTRA_USER_ID, "run2");
 chatFragment.setArguments(args);
 getSupportFragmentManager().beginTransaction().add(R.id.container, chatFragment).commit();
 

Yunzo_2015

赞同来自:

同问,我也是这种问题

夙愿終不毁

赞同来自:

大哥 关于环信集成EaseUI一发送文本消息就崩溃的原因解决了吗?图片和语音都可以,就是文本消息不行。
我的错误和搂住一毛一样

要回复问题请先登录注册

知识价值的认可,源自您的赞赏

扫描二维码,你的支付将由imGeek代收后转给对方

×