A
A
Anton Peat2014-10-21 16:31:24
Java
Anton Peat, 2014-10-21 16:31:24

How to remove and display code java layout by id?

In the standard android studio drawer activity example, in java there are lines like this:

public void onSectionAttached(int number) {
        switch (number) {
            case 1:
                mTitle = getString(R.string.title_section1);
                break;
            case 2:
                mTitle = getString(R.string.title_section2);
                break;
            case 3:
                mTitle = getString(R.string.title_section3);
                break;
        }
    }

Those. on click they change the title and I have to scroll through the screens here.
I placed the contents of the first tab in a LinearLayout, set id Main_lay (for example)
and placed them in xml ... How can I hide / show them on the screen in Cases (case 1:, case 2; ...) of this code?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question