{"action":"created","issue":{"url":"https://api.github.com/repos/YoKeyword/Fragmentation/issues/601","repository_url":"https://api.github.com/repos/YoKeyword/Fragmentation","labels_url":"https://api.github.com/repos/YoKeyword/Fragmentation/issues/601/labels{/name}","comments_url":"https://api.github.com/repos/YoKeyword/Fragmentation/issues/601/comments","events_url":"https://api.github.com/repos/YoKeyword/Fragmentation/issues/601/events","html_url":"https://github.com/YoKeyword/Fragmentation/issues/601","id":266360303,"number":601,"title":"华为机器上，一个多次调用  loadRootFragment 导致不显示的问题","user":{"login":"zhenian","id":18303646,"avatar_url":"https://avatars2.githubusercontent.com/u/18303646?v=4","gravatar_id":"","url":"https://api.github.com/users/zhenian","html_url":"https://github.com/zhenian","followers_url":"https://api.github.com/users/zhenian/followers","following_url":"https://api.github.com/users/zhenian/following{/other_user}","gists_url":"https://api.github.com/users/zhenian/gists{/gist_id}","starred_url":"https://api.github.com/users/zhenian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zhenian/subscriptions","organizations_url":"https://api.github.com/users/zhenian/orgs","repos_url":"https://api.github.com/users/zhenian/repos","events_url":"https://api.github.com/users/zhenian/events{/privacy}","received_events_url":"https://api.github.com/users/zhenian/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-10-18T04:58:05Z","updated_at":"2017-10-24T09:06:28Z","closed_at":"2017-10-24T09:06:28Z","author_association":"CONTRIBUTOR","body":"布局\r\n\r\n```\r\n<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\r\n    android:layout_width=\"match_parent\"\r\n    android:layout_height=\"match_parent\">\r\n    <FrameLayout\r\n        android:id=\"@+id/reader_layout_frame\"\r\n        android:layout_width=\"fill_parent\"\r\n        android:layout_height=\"fill_parent\">\r\n    </FrameLayout>\r\n    <FrameLayout\r\n        android:id=\"@+id/reader_menu_frame\"\r\n        android:layout_width=\"fill_parent\"\r\n        android:layout_height=\"fill_parent\"\r\n        android:background=\"@color/transparent_00\">\r\n    </FrameLayout>\r\n</RelativeLayout>\r\n```\r\n\r\n```\r\n    private SupportFragment currentFragment;\r\n    @Override\r\n    protected void openMenuFragment() {\r\n        Class<? extends SupportFragment> clazz = OnlineMenuFragment.class;\r\n        SupportFragment currentFragment = findFragment(clazz);\r\n        if (currentFragment == null) {\r\n            currentFragment = findChildFragment(clazz);\r\n        }\r\n        if (currentFragment == null) {\r\n            currentFragment = OnlineMenuFragment.newInstance(this.novelId);\r\n        }\r\n        menuFragment = currentFragment;\r\n        loadRootFragment(R.id.reader_menu_frame, currentFragment, true, false);\r\n        actionFrameLayout.setVisibility(View.VISIBLE);\r\n    }\r\n\r\n    protected void closeMenu() {\r\n        L.e(\" close menu\");\r\n        actionFrameLayout.setVisibility(View.GONE);\r\n        if (menuFragment != null) {\r\n            try {\r\n                menuFragment.pop();\r\n            } catch (java.lang.IllegalStateException e) {\r\n                e.printStackTrace();\r\n            }\r\n        }\r\n        menuFragment = null;\r\n    }\r\n```\r\n\r\n在华为的机器上，反复调用 `openMenuFragment()`和 `closeMenu()`多次后，就不显示 `OnlineMenuFragment`的内容了。\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/YoKeyword/Fragmentation/issues/comments/338924866","html_url":"https://github.com/YoKeyword/Fragmentation/issues/601#issuecomment-338924866","issue_url":"https://api.github.com/repos/YoKeyword/Fragmentation/issues/601","id":338924866,"user":{"login":"YoKeyword","id":9691640,"avatar_url":"https://avatars0.githubusercontent.com/u/9691640?v=4","gravatar_id":"","url":"https://api.github.com/users/YoKeyword","html_url":"https://github.com/YoKeyword","followers_url":"https://api.github.com/users/YoKeyword/followers","following_url":"https://api.github.com/users/YoKeyword/following{/other_user}","gists_url":"https://api.github.com/users/YoKeyword/gists{/gist_id}","starred_url":"https://api.github.com/users/YoKeyword/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/YoKeyword/subscriptions","organizations_url":"https://api.github.com/users/YoKeyword/orgs","repos_url":"https://api.github.com/users/YoKeyword/repos","events_url":"https://api.github.com/users/YoKeyword/events{/privacy}","received_events_url":"https://api.github.com/users/YoKeyword/received_events","type":"User","site_admin":false},"created_at":"2017-10-24T09:06:27Z","updated_at":"2017-10-24T09:06:27Z","author_association":"OWNER","body":"````java\r\n       if (menuFragment != null) { // 这里换成 if (menuFragment != null && menuFragment.isAdded()) 更安全\r\n            try {\r\n                menuFragment.pop();\r\n            } catch (java.lang.IllegalStateException e) {\r\n                e.printStackTrace();\r\n            }\r\n        }\r\n````"}}
{"actor":{"display_login":"YoKeyword"}}