How to hide NavigationView ? android:visibility="gone" is not working

I am using 2 ( Left and Right ) NavigationView for my app, and want to show right NavigationView for certain conditions only. Hence set its visibility to "GONE" in layout file and will make it visible when it is needed. However even after making it "GONE" right NavigationView keep showing up.