Android 为什么RecyclerView失去了对点击的关注?
我在片段中有一个recyclerview,在项目中单击我添加另一个片段,显示项目的详细信息。但当我在第一个片段中返回时,单击的项目失去焦点,无法触发单击Android 为什么RecyclerView失去了对点击的关注?,android,android-recyclerview,Android,Android Recyclerview,我在片段中有一个recyclerview,在项目中单击我添加另一个片段,显示项目的详细信息。但当我在第一个片段中返回时,单击的项目失去焦点,无法触发单击 DetailsFragment detailsFragment = new DetailsFragment(); Bundle b = detailsFragment.getArguments(); if (b == null) { b = new Bundle(); } b.putString(
DetailsFragment detailsFragment = new DetailsFragment();
Bundle b = detailsFragment.getArguments();
if (b == null) {
b = new Bundle();
}
b.putString(Constants.ID, id);
detailsFragment.setArguments(b);
getFragmentManager().beginTransaction()
.hide(this)
.add(R.id.fragment_container, detailsFragment, DetailsFragment.class.getSimpleName())
.addToBackStack(DetailsFragment.class.getSimpleName())
.commit();
你需要发布更多的代码。你在OnBackPressed方法中做了什么代码?同意@divyesh。你的听众长什么样?恢复最后一个片段时,您在做什么?在onbackpress中,我调用getFragmentManager().popBackStack();