// create a new TableRow TableRow row = new TableRow(this); row.setClickable(true); //allows you to select a specific row row.setOnClickListener(new OnClickListener() { public void onClick(View v) { v.setBackgroundColor(Color.GRAY); System.out.println("Row clicked: " + v.getId()); //get the data you need TableRow tablerow = (TableRow)v.getParent(); TextView sample = (TextView) tablerow.getChildAt(2); String result=sample.getText().toString(); } });
// create a new TableRow TableRow row = new TableRow(this); row.setClickable(true); //allows you to select a specific row row.setOnClickListener(new OnClickListener() { public void onClick(View v) { v.setBackgroundColor(Color.GRAY); System.out.println("Row clicked: " + v.getId()); //get the data you need TableRow tablerow = (TableRow)v.getParent(); TextView sample = (TextView) tablerow.getChildAt(2); String result=sample.getText().toString(); } });
rowText = rowsArray.getJSONObject(i).getJSONArray("Cells").getJSONObject(k).getString("CellValue"); headerText = (String) ((TextView) invisibleHeaderRow.getChildAt(k)).getText(); if (headerText.length() > rowText.length()) invisibledataRow.addView(GetItemTextViewHidden(this, headerText, "C")); else { invisibledataRow.addView(GetItemTextViewHidden(this, rowsArray.getJSONObject(i).getJSONArray("Cells").getJSONObject(k).getString("CellValue"), "C")); ((TextView) invisibleHeaderRow.getChildAt(k)).setText(rowText); ((TextView) invisibleHeaderRow.getChildAt(k)).setText(footerArray.getJSONObject(i).getJSONArray("Cells").getJSONObject(k).getString("CellValue"));
for (int i = 0; i < mTable.getChildCount(); i++) { TableRow mRow = (TableRow) mTable.getChildAt(i); Spinner mspinner = (Spinner) mRow.getChildAt(0); TextView mTextView = (TextView) mRow.getChildAt(1); Log.i("mspinner", "" + mspinner.getSelectedItem()); total = total