我在真实设备上的DialogFragment出现了一些奇怪的问题。三星Galaxy Note 4.导致ANR的DialogFragment
当我尝试打开一个对话框时,应用程序进入一个无限循环(来自系统的东西),并在一段时间后给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。 该死的服务。
请发布代码片段 – 2015-04-03 15:06:52