I had a very strange problem. My situation:
I created an application containing many pages, each page is a Fragment . And I used RecyclerView and CardView inside each page. The layout of the main page is as follows:

When I click an image element to go to the detail page, then click the back button right after that, my home page will appear, but:

As you can see, all the shadow and corner effect disappeared , scrolling did not work when I touch an element that takes a few seconds before moving around the detailed page . When a detailed page is displayed, everything returns to normal. Here is my fragment replacement method:
public void replaceBackgroundFragment(Fragment mf, String tag, boolean addBackStack) { if (mf != null && (currentFragmentTag == null || !currentFragmentTag.equals(tag))) { FragmentTransaction ft = fragmentManager.beginTransaction(); ft.setCustomAnimations(R.anim.slide_in_right, R.anim.slide_out_left, R.anim.slide_in_left, R.anim.slide_out_right); ft.replace(R.id.rl_background, mf, tag); if (addBackStack) { mf.setCanBack(true); ft.addToBackStack(tag); } ft.commit(); pendingFragment = null; pendingTag = null; } }
When you click on an item:
public void onItemClick(MainBanner item) { MoviePlayerFragment fragment = MoviePlayerFragment.newInstance(item.getItemID()); activity.replaceBackgroundFragment(fragment, "movie_player_fragment" + item.getItemID(), true); }
EDIT I used setRetainInstance(true); in my Fragment
Can anyone tell me what is going on?