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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:18:56+00:00 2026-05-26T06:18:56+00:00

I got confused by the Android SDK API. I invoked the GroupView.RemoveAllViews to clean

  • 0

I got confused by the Android SDK API.
I invoked the GroupView.RemoveAllViews to clean all the child views, however, the UI does not refresh.
By the way, I tried the RemoveViewAt(0) several times and A NullReference Exception occured, which means the sub view was removed but the UI does not change.
Any help will be appreciated. Thank you so much.

This is part of the source code.

   private TableLayout contentTable;

   @Override
   protected void onLayout(boolean changed, int l, int t, int r, int b) {
      contentTable = new TableLayout(this.getContext());
      for(int  i = 0 ; i < 10 ; i ++)
      {
         TableRaw tr = new  TableRaw(this.getContext());
         Button b = new Button(this.getContext());
         b.setOnClickListener(new OnClickListener(){
               public void onClick(View v) {
           // TODO Auto-generated method stub
           Clean()
           }
         });
         tr.addView(b);
         contentTable.addView(tr);
      }
     super.onLayout(changed, l, t, r, b);
   }

   private void Clean()
   {
      contentTable.removeAllViews();
      this.invalidate();
    }
  • 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-26T06:18:56+00:00Added an answer on May 26, 2026 at 6:18 am

    You need to invalidate your layout. use invalidate() method to your GroupView.

    GroupView.invalidate()
    

    From what I get from your comments.

    I believe you have main activity as follow.

    public class YourActivity extends Activity {
        testView yourviewGroup;
    
        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            yourviewGroup = (testView)findViewById(R.id.yourid);
    
            /**if you want to clean your viewgroup **/
            yourviewGroup.Clean();
            yourviewGroup.invalidate();
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing my first location based android app, but got confused about some of
I got really confused of all the W3C specifications and implementations of different browsers.
Ive been doing some reading, and got a little confused. In Android development, is
I am trying to rotate vectors using matrices, but got confused. I thought all
I've got confused . We hear a lot about Provider in ASP.NET . Membership-Provider
today I got confused when doing a couple of <%=Html.LabelFor(m=>m.MyProperty)%> in ASP.NET MVC 2
I was actually going through the question 1636644 .. and got confused with this
I have the following code and got myself confused: I have a query that
I'm new in Reporting services and got little confused. in the screen shot you
I'm quite confused by something. I've got 2 select lists, and if you choose

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.