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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T13:45:31+00:00 2026-06-03T13:45:31+00:00

final TableLayout table = (TableLayout) findViewById(R.id.tableLayout); TableRow row = new TableRow(this); TextView t2 =

  • 0
    final TableLayout table = (TableLayout) findViewById(R.id.tableLayout);
    TableRow row = new TableRow(this);


    TextView t2 = new TextView(this);
    t2.setText("test");
    row.addView(t2);

    Button bu = new Button(this);
    bu.setBackgroundResource(R.drawable.del);
    bu.setOnClickListener(new Button.OnClickListener() {

        @Override
        public void onClick(View v) {

            //I need to delete the tablerow
                            //how to do?

        }

    });
    row.addView(bu);

    table.addView(row, new TableLayout.LayoutParams(WC, WC));

**
i want to delete tablerow in bu.setOnClickListener
how to do removeViewAt() ,i cant find indexId
**

  • 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-06-03T13:45:34+00:00Added an answer on June 3, 2026 at 1:45 pm

    use removeView for removing tablerow as:

    table.removeView(row);
    

    NOTE: If they don’t have unique id then use:

    table.removeView(rowIndex);
    

    and by using removeViewAt

    for(int i = 0, j < table.getChildCount(); i < j; i++){ 
        // then, you can remove the the row you want... 
        // for instance... 
        TableRow row = getChildAt(i); 
        if( something you want to check ) { 
            removeViewAt(i); 
            // or... 
            removeView(row); 
        } 
    } 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

final TextView dob = (TextView) findViewById(R.id.TextView_DOB); DatePickerDialog dateDialog = new DatePickerDialog(this, new DatePickerDialog.OnDateSetListener() {
final ListView lv= (ListView)findViewById(R.id.list); String[] from = new String[] {a, b,c}; int[] to =
final String encodedURL = URLEncoder.encode(urlAsString, UTF-8); URL url = new URL(encodedURL); I take this
final JFileChooser fc = new JFileChooser(); int returnVal = fc.showOpenDialog(this); if (returnVal == JFileChooser.APPROVE_OPTION)
final CharSequence[] items = {Red, Green, Blue} AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setTitle(Pick a
final ProgressDialog Pdialog = ProgressDialog.show(SpinnerClass.this, , Loading. Please wait..., true); Thread ProgressThread = new
final Criteria crit = session.createCriteria(MyClass.class); final List<MyClass> myClassList = crit.list(); results in this :
Final working code based on accepted answer $('#photo-upload, #photo-upload .close').click(function(){ $('#photo-upload').removeClass('show'); }); $('#upload-button').click(function(){ $('#photo-upload').addClass('show');
Final Update : Turns out the fix to this problem is a depressing one.
In main.xml I made a row containing a TextView, an EditText and 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.