Issue adding table row to table layout?

You're not calling setContentView() anywhere. You create this layout but never assign it to the activity. I think what you want to do is after you've set up all your layout stuff.

Up vote 0 down vote favorite share g+ share fb share tw.

I have the following code: HashMap tip = venue.tips. Get(j); TableRow tr = new TableRow(this); TableRow. LayoutParams tableRowParams = new TableRow.

LayoutParams (TableRow.LayoutParams. FILL_PARENT,TableRow.LayoutParams. WRAP_CONTENT); tr.

SetLayoutParams(tableRowParams); LinearLayout ll = new LinearLayout(this); ll. SetLayoutParams(new LinearLayout. LayoutParams(LinearLayout.LayoutParams.

WRAP_CONTENT, LinearLayout.LayoutParams. WRAP_CONTENT)); TextView tips = new TextView(this); tips. SetText(tip.

Get("text")); Log. V("TIPS TEXT", tip. Get("text")); tips.

SetLayoutParams(new LayoutParams( LayoutParams. WRAP_CONTENT, LayoutParams. WRAP_CONTENT)); ImageView avatar = new ImageView(this); avatar.

SetImageBitmap(getBitmapFromURL(tip. Get("photo"))); Log. V("PHOTO URL", tip.

Get("photo")); avatar. SetLayoutParams(new LayoutParams(LayoutParams. WRAP_CONTENT, LayoutParams.

WRAP_CONTENT)); ll. AddView(tips); ll. AddView(avatar); tr.

AddView(ll); View v = new View(this); v. SetLayoutParams(new TableRow. LayoutParams(TableRow.LayoutParams.

FILL_PARENT, 1)); v. SetBackgroundColor(Color. Rgb(51, 51, 51)); tipsTable.

AddView(tr,new TableLayout. LayoutParams( LayoutParams. FILL_PARENT, LayoutParams.

WRAP_CONTENT)); tipsTable. AddView(v); I think I did something wrong with setting up the layout, but the issue now is that I can't see the rows added to the tipsTable. Why is this?

Java android tablelayout tablerow link|improve this question edited Nov 27 '11 at 15:05 asked Nov 27 '11 at 5:44xonegirlz4418 75% accept rate.

You're not calling setContentView() anywhere. You create this layout but never assign it to the activity. I think what you want to do is after you've set up all your layout stuff: setContentView(ll).

Doing that gives me an error – xonegirlz Nov 27 '11 at 14:58.

Along the same line: tipsTable seems to be your top view so try setContentView(tipsTable).

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions