Example usage for android.widget TableLayout getParent

List of usage examples for android.widget TableLayout getParent

Introduction

In this page you can find the example usage for android.widget TableLayout getParent.

Prototype

public final ViewParent getParent() 

Source Link

Document

Gets the parent of this view.

Usage

From source file:com.lifehackinnovations.siteaudit.FloorPlanActivity.java

public void grabsamcounts() {

    int[] samcount = new int[view.maxelcs];
    for (int h = 0; h < samcount.length; h++) {
        samcount[h] = 0;/*from ww w.  ja v  a  2s . c o  m*/
    }

    int rownum = 0;

    try {
        View firstview;
        TableRow tablerow;
        TableLayout tablelayout;
        LinearLayout linearlayout;

        firstview = Tabs1.mcrentries[Tabs1.METERINGLIST][rownum][u.cellx("B1")];
        tablerow = ((TableRow) firstview.getParent());
        tablelayout = ((TableLayout) tablerow.getParent());
        linearlayout = (LinearLayout) tablelayout.getParent();

        Log.d("tablelayoutchild count", u.s(linearlayout.getChildCount()));
        for (int k = 0; k < linearlayout.getChildCount(); k++) {

            int elcnum = u.i(Tabs1.mcrentries[Tabs1.METERINGLIST][k][u.cellx("B1")].getText().toString());

            for (int y = 0; y < view.i; y++) {
                if ((view.ITEMtype[y] == view.TYPE_ELC) && view.ELCdisplaynumber[y] == elcnum) {
                    samcount[elcnum]++;
                }
            }
        }
        for (int y = 0; y < view.i; y++) {
            if ((view.ITEMtype[y] == view.TYPE_ELC)) {
                view.ITEMsamscount[y] = samcount[view.ELCdisplaynumber[y]];
            }
        }
    } catch (Throwable e) {

    }
}