Skip to content

Commit 2b93196

Browse files
guangyaoguangyao
authored andcommitted
2 parents 7de39ba + 1289444 commit 2b93196

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

android/src/main/java/com/netease/im/ReactCache.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,9 @@ public static Object createRecentList(List<RecentContact> recents, int unreadNum
208208
}
209209
CustomAttachment attachment = null;
210210
try {
211-
attachment = (CustomAttachment) contact.getAttachment();
211+
if (contact.getMsgType() == MsgTypeEnum.custom) {
212+
attachment = (CustomAttachment) contact.getAttachment();
213+
}
212214
} catch (Exception e) {
213215
e.printStackTrace();
214216
}
@@ -747,7 +749,7 @@ public static WritableMap createMessage(IMMessage item) {
747749
imageObj.putString("thumbPath", imageAttachment.getPath());
748750
} else {
749751
imageObj.putString("thumbPath2", imageAttachment.getThumbPathForSave());
750-
imageObj.putString("thumbPath", imageAttachment.getThumbPath());
752+
imageObj.putString("thumbPath", imageAttachment.getThumbPath());
751753
}
752754
imageObj.putString("path2", imageAttachment.getPathForSave());
753755
imageObj.putString("path", imageAttachment.getPath());

android/src/main/java/com/netease/im/session/AudioMessageService.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import android.content.Context;
44
import android.os.Handler;
5+
import android.os.Looper;
56
import android.os.Message;
67
import android.widget.Toast;
78

@@ -51,7 +52,7 @@ public void startAudioRecord(Context context) {
5152
audioMessageHelper = new AudioRecorder(context, RecordType.AAC, currMaxTime, this);
5253
}
5354
if (handler == null) {
54-
handler = new Handler() {
55+
handler = new Handler(Looper.getMainLooper()) {
5556
@Override
5657
public void handleMessage(Message msg) {
5758
if (msg.what == WHAT_AUDIO) {

0 commit comments

Comments
 (0)