I have a res/layout/main.xml including these elements and others:
I had the same problem. My mistake was that: I wrote
LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View layout=inflater.inflate(R.layout.dlg_show_info, null);
alertDlgShowInfo.setView(layout);
TableRow trowDesc=(TableRow)findViewById(R.id.trowDesc);
and as I used an inflater to "load" the view from an XML file, the last line was wrong. To solve it, I had to write:
TableRow trowDesc=(TableRow)layout.findViewById(R.id.trowDesc);
I wrote my solution, in case someone have the same problem.