So i've been trying to do that and it basically says that the "content" that i'm trying to get is null. This is the code that i'm testing (the commented part is the actual code that i'm trying to get it to work i just added the println to see if the data that was getting was right, which it wasn't)
public void FiltarBusqueda(String filtro) {
int count=0;
for (int r = 0; r < mTableLayout.getChildCount(); r++) {
TableRow trow = (TableRow) mTableLayout.getChildAt(r);
for(int c=0;c <= trow.getChildCount();c++){
System.out.println(""+trow.getChildAt(c));
/*if (trow.getChildAt(c).toString() != filtro) {
count++; }
if(count==3){
mTableLayout.removeView(trow); }*/
}
}
}
public void onClickFiltro(View v){
EditText filtro = (EditText)findViewById(R.id.txtproducto);
FiltarBusqueda(filtro.getText().toString());
}
*Also the thing that creates the tablerows for each is in the same class *LinearLayout Thing:
final LinearLayout layCustomer = new LinearLayout(this);
layCustomer.setOrientation(LinearLayout.VERTICAL);
layCustomer.setPadding(0, 10, 0, 10);
layCustomer.setBackgroundColor(Color.parseColor("#f8f8f8"));
final TextView tv3 = new TextView(this);
if (i == -1) {
tv3.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.MATCH_PARENT,
TableRow.LayoutParams.MATCH_PARENT));
tv3.setPadding(5, 5, 0, 5);
tv3.setTextSize(TypedValue.COMPLEX_UNIT_PX, smallTextSize);
} else {
tv3.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.MATCH_PARENT,
TableRow.LayoutParams.MATCH_PARENT));
tv3.setPadding(5, 0, 0, 5);
tv3.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize);
}
tv3.setGravity(Gravity.TOP);
if (i == -1) {
tv3.setText("Productos");
tv3.setBackgroundColor(Color.parseColor("#f0f0f0"));
} else {
tv3.setBackgroundColor(Color.parseColor("#f8f8f8"));
tv3.setTextColor(Color.parseColor("#000000"));
tv3.setTextSize(TypedValue.COMPLEX_UNIT_PX, smallTextSize);
tv3.setText(row.productName);
}
layCustomer.addView(tv3);