Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4549348
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T16:20:53+00:00 2026-05-21T16:20:53+00:00

In my application, I have 2 LinearLayout ‘s right above each other. Via a

  • 0

In my application, I have 2 LinearLayout‘s right above each other. Via a menu option, I want to be able to make the bottom one disappear, and have the top one drop down over the disappeared LinearLayout.

The problem is, I have no idea on how to do this in Java.

It doesn’t have to be animated, I want to hide the Layout on return of another activity (the menu), in OnActivityResult. The menu activity sets a boolean on which I check in OnActivityResult, and according to it’s value I determine if I need to hide or show the bottom Layout:

// Only change value if it is different from what it was.
if(mUseVolumeButtonAsPTT != resultData.getBoolean("UseVolumeButtonAsPTT")){
    mUseVolumeButtonAsPTT = resultData.getBoolean("UseVolumeButtonAsPTT");
    if(!mUseVolumeButtonAsPTT){
        // Hide lower LinearLayout.
    } else {
        // Show lower LinearLayout.
    }
}

Can anybody give me a hint or a link on how I should do this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T16:20:54+00:00Added an answer on May 21, 2026 at 4:20 pm

    You can call view.setVisibility(View.GONE) if you want to remove it from the layout.

    Or view.setVisibility(View.INVISIBLE) if you just want to hide it.

    From Android Docs:

    INVISIBLE

    This view is invisible, but it still takes up space for layout purposes. Use with setVisibility(int) and android:visibility.

    GONE

    This view is invisible, and it doesn’t take any space for layout purposes. Use with setVisibility(int) and android:visibility.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi i have an application, where i want to use scroll option in liner
I have an android application where I want to display a LinearLayout when user
I have an game application I have written for Windows Mobile and I want
I have an application, which has a Spinner that I want populated with some
I want to create an Application with tabs, and I have found this guide
i have created a login page for some application in android and i want
((TextView)((FrameLayout)((LinearLayout)((ViewGroup)getWindow().getDecorView()).getChildAt(0)).getChildAt(0)).getChildAt(0)).setGravity(Gravity.CENTER); I have used this above code for aligning my title of activity in
I have a adView in my application UI i don't want to display it
I have a LinearLayout in my android application. Worked well with just the two
I'm developing an Android 2.2 application. I have a linearlayout with a textview, a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.