Android: fragments overlapping issue

Just set a background color to your <fragment /> in XML file.

Solves the issue.

I may be very late to answer this question.


This answer may not be related to the above question, But hope it will help for some.

Sometimes, Fragment overlap issue occurs when we try to use the different type of fragments( i.e using support fragment’s in few fragments and normal fragments in someother fragment )

Recently i faced the same problem in Navigation drawer.
By mistake, i used “import;” in one fragment, And used “import;” in few other fragment.

Hope this will help for somebody..

Well Setting up fragment background color is not a solution because fragment will be still in the activity stack which may consume memory.

Solution would be remove all views from your framelayout before adding any new fragment.

private void changeFragment(Fragment fr){
    FrameLayout fl = (FrameLayout) findViewById(;
    FragmentTransaction transaction1 = getSupportFragmentManager().beginTransaction();
    transaction1.add(, fr);

Leave a Comment