我在真实设备上使用 DialogFragment 时遇到一些奇怪的问题。三星 Galaxy Note 4。
当我尝试打开对话框时,应用程序进入无限循环(来自系统的某些内容),并在一段时间后给出 ANR。一切都被封锁了。没有日志。在调试时,断点位于对话框的 show 方法之后。
这是我用来显示对话框的方法:
public void openLivecastMenuDialog() {
MenuDialog menuDialog = (MenuDialog) getSupportFragmentManager().findFragmentByTag(MENU_STORY_TAG);
if (null == menuDialog) {
// Menu fragment not found in the fragment manager, initialize it
menuDialog = MenuDialog.newInstance(MenuType.MENU_STORY, currentTag);
}
isCoverChanged = false;
// Show the menu fragment
menuDialog.show(getSupportFragmentManager(), MENU_STORY_TAG);
}
MenuDialog 是一个“v4.app.DialogFragment”。
什么会造成这种行为?
LE:
这不是因为 DialogFragment。这是因为创建对话框时调用了 Google Analytics。 这些服务该死。
最佳答案
这不是因为 DialogFragment。这是因为创建对话框时调用了 Google Analytics。这些服务该死。
关于android - DialogFragment 导致 ANR,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29434646/