在我的应用程序中,我正在使用导航抽屉,它运行得非常好。但是,如果要显示的片段包含许多TextView、ImageView和Layout,当我单击该项时,视图会出现故障。我想改善这种滞后。在我的Galaxy Nexus和Nexus 4上出现了相同的效果,因此我认为问题在于我同时有两个命令。
//On item click - First comand (Close Drawer)
mDrawerList.setItemChecked(position, true);
setTitle(mStringTitles[position]);
mDrawerLayout.closeDrawer(mDrawerView);
// Second comand (Replace Fragment)
getFragmentManager()
.beginTransaction()
.replace(R.id.firts_view, new FragmentNew())
.commit();
所以我想在菜单关闭后替换片段.. 有什么想法吗?