fix crash due to external app notification
package com.applozic.mobicomkit.uiwidgets.attachmentview;
+import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.graphics.PorterDuff;
@@ -370,6 +371,11 @@ public class ApplozicDocumentView {
}
public void setAudioIcons() {
+ if (context instanceof Activity) {
+ ((Activity) context).runOnUiThread(new Runnable() {
+ @Override
+ public void run() {
+ if (message != null && docIcon != null) {
int state = ApplozicAudioManager.getInstance(context).getAudioState(message.getKeyString());
Utils.printLog(context, "state:", String.valueOf(state));
docIcon.setVisibility(View.VISIBLE);
@@ -379,6 +385,10 @@ public class ApplozicDocumentView {
docIcon.setImageResource(R.drawable.ic_play_circle_outline);
}
}
+ }
+ });
+ }
+ }
public boolean isUploadRequire() {
return (message.hasAttachment() && message.isTypeOutbox() && !message.isSentToServer());
