I want to hide framelayout dynmically in android, How I can achieve this.
provide an id attribute to your frameLayout by defining it in xml file as:
android:id="@+id/someID"
and in code, write following:
FrameLayout layout = (FrameLayout)findViewById(R.id.someID);
layout.setVisibility(View.GONE);
You can also use
View.INVISIBLE
which means the element will be still there.
Change the visibility like this:
FrameLayout layout = (FrameLayout) findViewById (R.id.your_id);
layout.setVisibility (View.GONE); // or View.INVISIBLE, depending on what you exactly want
You can hide or show views using setVisibility(int).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With