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 3310508
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T21:46:07+00:00 2026-05-17T21:46:07+00:00

I am new to Android.Can anyone give some ideas for my problem. /* Parent

  • 0

I am new to Android.Can anyone give some ideas for my problem.

    /* Parent Linear Layout */

    final LinearLayout par_layout=new LinearLayout(this);
    par_layout.setOrientation(LinearLayout.VERTICAL);

    /* Child Linear Layout */
    final LinearLayout chl_layout=new LinearLayout(this);
    chl_layout.setOrientation(LinearLayout.VERTICAL);

    TextView tv_name=new TextView(this);
    tv_name.setText("Name ");

    TextView tv_item=new TextView(this);
    tv_item.setText("Items ");

    Button btn_submit=new Button(this);
    btn_submit.setText("Submit");
    btn_submit.setOnClickListener(new OnClickListener() {           
        @Override
        public void onClick(View v) {
            // TODO Auto-generated method stub
            par_layout.removeAllViewsInLayout();                
        }
    });

    chl_layout.addView(tv_name);
    chl_layout.addView(tv_item);
    chl_layout.addView(btn_submit);        
    par_layout.addView(chl_layout); 
    setContentView(par_layout);

In the above code at the time of button click i wish to clear the chl_layout from the par_layout.But i can’t . Can anyone give some ideas ??

Note :
The following code also not working

 par_layout.removeView(chl_layout);
  • 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-17T21:46:07+00:00Added an answer on May 17, 2026 at 9:46 pm

    Use below code to remove child view from parent view.

     par_layout.removeView(chl_layout);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am new to Android. can anyone tell me about Android that how can
Can anyone please provide me some idea/guidance on how to save an image from
I'm new in Android dev and I have a ridiculous question.. I read this
New to javascript/jquery and having a hard time with using this or $(this) to
New to WCF, but familiar with COM+ - can I wrap a WCF service
Being new to test based development, this question has been bugging me. How much
I'm fairly new to the Android platform and was wondering if I could get
I'm trying to create a scrollable layout in Android. Even using developers.android.com, though, I
How to register a new MIME type in android? I am very much new
I am completely new to android, and pretty much a Java newb. I have

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.