Code example for TableRow

Methods: getChildAt

0
     
    public List<String> getRowChildren(TableRow tr) {
    	List<String> rowValues = new ArrayList<String>();
    	 
    	//Get MaxReps 
		if (tr.getChildAt(1) instanceof TextView) {
			TextView tv = (TextView) tr.getChildAt(1);
			rowValues.add(tv.getText().toString());	
		} 
		 
		//Get Attempted Reps 
		if (tr.getChildAt(2) instanceof Spinner) {
    		Spinner spinner = (Spinner) tr.getChildAt(2);
			rowValues.add(spinner.getSelectedItem().toString());
		} 
		 
		//Get Weight 
		if (tr.getChildAt(3) instanceof EditText) {
			EditText et = (EditText) tr.getChildAt(3);
			if (et.getText().toString().length() > 0) {
				rowValues.add(et.getText().toString());	
			} else { 
				rowValues.add(et.getHint().toString());
 
Stop searching for code, let great code find you!  Add Codota to your java IDE