When a button is clicked, the following method is run:
public void createTableRow(View v) { TableLayout tl = (TableLayout) findViewById(R.id.spreadsheet);
As it turns out, Eclipse is not always right. Ctrl+Shift+M made the wrong import. It had import android.view.ViewGroup.LayoutParams when it should have import android.widget.TableRow.LayoutParams
import android.view.ViewGroup.LayoutParams
import android.widget.TableRow.LayoutParams
Everything works fine now.