修复一处闪退bug
This commit is contained in:
parent
ad26ae7db8
commit
83ee1f94df
@ -333,7 +333,7 @@ public class AppContext extends CommonAppContext {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void setFirebaseCrashData() {
|
public static void setFirebaseCrashData() {
|
||||||
if (!CommonAppConfig.IS_UPLOAD_ERROR_LOG) {
|
if (!CommonAppConfig.IS_UPLOAD_ERROR_LOG) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -8,11 +8,13 @@ import android.os.Looper;
|
|||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import com.google.firebase.crashlytics.FirebaseCrashlytics;
|
||||||
import com.yunbao.common.BuildConfig;
|
import com.yunbao.common.BuildConfig;
|
||||||
import com.yunbao.common.bean.CrashSaveBean;
|
import com.yunbao.common.bean.CrashSaveBean;
|
||||||
import com.yunbao.common.utils.AppManager;
|
import com.yunbao.common.utils.AppManager;
|
||||||
import com.yunbao.common.utils.FileUtil;
|
import com.yunbao.common.utils.FileUtil;
|
||||||
import com.yunbao.common.utils.SpUtil;
|
import com.yunbao.common.utils.SpUtil;
|
||||||
|
import com.yunbao.common.utils.ToastUtil;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.PrintWriter;
|
import java.io.PrintWriter;
|
||||||
@ -105,7 +107,8 @@ public class NeverCrashUtils {
|
|||||||
Log.e(TAG, "未捕获的主线程异常行为", e);
|
Log.e(TAG, "未捕获的主线程异常行为", e);
|
||||||
}
|
}
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
AppContext.setFirebaseCrashData();
|
||||||
|
FirebaseCrashlytics.getInstance().recordException(e);
|
||||||
AppManager.runDebugCode(() -> Toast.makeText(application, "发生闪退:" + e.getMessage(), Toast.LENGTH_SHORT).show());
|
AppManager.runDebugCode(() -> Toast.makeText(application, "发生闪退:" + e.getMessage(), Toast.LENGTH_SHORT).show());
|
||||||
FileUtil.saveStringToFile(new File(application.getDir("files", Context.MODE_PRIVATE).getAbsolutePath()), throwableToString(e), "error.log");
|
FileUtil.saveStringToFile(new File(application.getDir("files", Context.MODE_PRIVATE).getAbsolutePath()), throwableToString(e), "error.log");
|
||||||
getMainCrashHandler().mainException(Looper.getMainLooper().getThread(), e);
|
getMainCrashHandler().mainException(Looper.getMainLooper().getThread(), e);
|
||||||
|
@ -1072,9 +1072,9 @@ public class LiveAudienceActivity extends LiveActivity {
|
|||||||
"?uid=" + userInfo.getId() +
|
"?uid=" + userInfo.getId() +
|
||||||
"&token=" + userInfo.getToken() + "&anchorUid=" + mLiveUid);
|
"&token=" + userInfo.getToken() + "&anchorUid=" + mLiveUid);
|
||||||
}
|
}
|
||||||
bundle.putString("liveUid",mLiveUid);
|
bundle.putString("liveUid", mLiveUid);
|
||||||
bundle.putString("anchorName",mAncherName);
|
bundle.putString("anchorName", mAncherName);
|
||||||
bundle.putString("mStream",mStream);
|
bundle.putString("mStream", mStream);
|
||||||
liveFansFragment.setArguments(bundle);
|
liveFansFragment.setArguments(bundle);
|
||||||
liveFansFragment.show(getSupportFragmentManager(), "LiveGuardDialogFragment");
|
liveFansFragment.show(getSupportFragmentManager(), "LiveGuardDialogFragment");
|
||||||
break;
|
break;
|
||||||
@ -1448,7 +1448,7 @@ public class LiveAudienceActivity extends LiveActivity {
|
|||||||
break;
|
break;
|
||||||
case GIFT_WALL:
|
case GIFT_WALL:
|
||||||
if (manager != null) {
|
if (manager != null) {
|
||||||
manager.showGiftWall(event.getUid(),event.isVoicePress(),event.getUname(),event.getAvatar());
|
manager.showGiftWall(event.getUid(), event.isVoicePress(), event.getUname(), event.getAvatar());
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -1568,7 +1568,7 @@ public class LiveAudienceActivity extends LiveActivity {
|
|||||||
JSONObject item = (JSONObject) o;
|
JSONObject item = (JSONObject) o;
|
||||||
List<LiveGiftBean> giftlist = JSONArray.parseArray(item.getJSONArray("giftlist").toJSONString(), LiveGiftBean.class);
|
List<LiveGiftBean> giftlist = JSONArray.parseArray(item.getJSONArray("giftlist").toJSONString(), LiveGiftBean.class);
|
||||||
for (LiveGiftBean bean : giftlist) {
|
for (LiveGiftBean bean : giftlist) {
|
||||||
if (bean!=null&&!bean.getSwf().isEmpty()) {
|
if (bean != null && !bean.getSwf().isEmpty()) {
|
||||||
giftBeanList.add(bean);
|
giftBeanList.add(bean);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1594,7 +1594,7 @@ public class LiveAudienceActivity extends LiveActivity {
|
|||||||
|
|
||||||
@SuppressLint("SetTextI18n")
|
@SuppressLint("SetTextI18n")
|
||||||
public void showMsgRed(int num) {
|
public void showMsgRed(int num) {
|
||||||
if (manager == null) {
|
if (manager == null || manager.mLiveAudienceViewHolder == null || manager.mLiveAudienceViewHolder.mRedPoint == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (num == -1) {
|
if (num == -1) {
|
||||||
@ -1605,10 +1605,14 @@ public class LiveAudienceActivity extends LiveActivity {
|
|||||||
}
|
}
|
||||||
manager.mLiveAudienceViewHolder.mRedPoint.setVisibility(View.VISIBLE);
|
manager.mLiveAudienceViewHolder.mRedPoint.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
public void setShowCrownRed(boolean isShow){
|
|
||||||
if(isShow){
|
public void setShowCrownRed(boolean isShow) {
|
||||||
|
if (manager == null || manager.mLiveAudienceViewHolder == null || manager.mLiveAudienceViewHolder.mRedPointPrivilege == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (isShow) {
|
||||||
manager.mLiveAudienceViewHolder.mRedPointPrivilege.setVisibility(View.VISIBLE);
|
manager.mLiveAudienceViewHolder.mRedPointPrivilege.setVisibility(View.VISIBLE);
|
||||||
}else{
|
} else {
|
||||||
manager.mLiveAudienceViewHolder.mRedPointPrivilege.setVisibility(View.GONE);
|
manager.mLiveAudienceViewHolder.mRedPointPrivilege.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user