locoboy locoboy - 24 days ago 10
Android Question

Android force quitting

I'm running this code and the emulator is posting a force quit. Does anyone know what could be wrong?

TableLayout tl = (TableLayout)findViewById(R.id.tableLayout1);
TableRow tr = new TableRow(this);
tr.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));

ImageView IV = new ImageView(this);
IV.setBackgroundResource(R.drawable.celtics);
IV.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.WRAP_CONTENT));
tr.addView(IV);
tl.addView(tr);

Answer

I actually found a way to get around this by doing this dynamically. I deleted the xml file and created the table in Java