【发布时间】:2019-07-08 00:55:39
【问题描述】:
我将 firebase 云消息添加到应用程序。接收数据消息时,我正在调用当前活动中的方法。该方法包括一个凌空发帖请求。
仅在华为设备中发生的 ANR。我希望有人能给我一个想法。谢谢。
ANR 堆栈:
Input dispatching timed out (Waiting to send key event because the focused window has not finished processing all of the input events that were previously delivered to it. Outbound queue length: 0. Wait queue length: 2.)
"main" tid=1 Native
"main" prio=5 tid=1 Native
| group="main" sCount=1 dsCount=0 flags=1 obj=0x73056ad0 self=0x78122a3a00
| sysTid=20046 nice=-10 cgrp=default sched=0/0 handle=0x78171f79b0
| state=S schedstat=( 7479347944 793149495 9121 ) utm=657 stm=90 core=2 HZ=100
| stack=0x7fff6b9000-0x7fff6bb000 stackSize=8MB
| held mutexes=
#00 pc 0000000000069800 /system/lib64/libc.so (__epoll_pwait+8)
#01 pc 000000000001f6c0 /system/lib64/libc.so (epoll_pwait+48)
#02 pc 0000000000015c80 /system/lib64/libutils.so (_ZN7android6Looper9pollInnerEi+144)
#03 pc 0000000000015b68 /system/lib64/libutils.so (_ZN7android6Looper8pollOnceEiPiS1_PPv+108)
#04 pc 000000000011a5dc /system/lib64/libandroid_runtime.so (???)
#05 pc 00000000002014ac /system/framework/arm64/boot-framework.oat (Java_android_os_MessageQueue_nativePollOnce__JI+140)
at android.os.MessageQueue.nativePollOnce (MessageQueue.java)
at android.os.MessageQueue.next (MessageQueue.java:379)
at android.os.Looper.loop (Looper.java:144)
at android.app.ActivityThread.main (ActivityThread.java:7523)
at java.lang.reflect.Method.invoke (Method.java)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run (Zygote.java:245)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:921)
Java 代码: dEmptyOperation 类扩展自 AsyncTask。 refreshList 的方法包括一个 volley post 请求
@Override
public void onMessageReceived(RemoteMessage remoteMessage) {
// .. if statement codes
new dEmptyOperation() {
@Override
protected String doInBackground(String... params) {
if (main.refreshActivity != null) {
try {
main.refreshActivity.refreshList();
main.refresh = false;
}catch (Exception ignored){
}
}
return null;
}
}.execute("");
//..
}
【问题讨论】:
标签: android firebase android-anr-dialog