Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Open Source License 

import android.view.View;
import android.view.ViewGroup;

import android.widget.TableLayout;
import android.widget.TableRow;

public class Main {
    /**
     * Clears all of the TableRows from a TableLayout, with the EXCEPTION
     * of the first row! The first row should be the component category
     * (Situps, Pushups, Run, Waist) and should therefore never be deleted.
     * @param table
     */
    public static void clearAfiTable(TableLayout table) {
        int count = table.getChildCount();
        for (int i = 1; i < count; i++) {
            View child = table.getChildAt(i);
            if (child instanceof TableRow)
                ((ViewGroup) child).removeAllViews();
        }
    }
}