android - Add array of strings to linear layout -


my code below. displaying details, not in proper way. can please me?

textview tv1=new textview(this); tv1.settext("displayname:"+strdisplayname);  textview tv2=new textview(this); tv2.settext("email:"+stremail);  textview tv3=new textview(this); tv3.settext("firstname:"+strfirstname);  textview tv4=new textview(this); tv4.settext("lastname:"+strlastname);  textview tv5=new textview(this); tv5.settext("createddate:"+strcreateddate);  mprofilelayout.addview(tv1, new layoutparams(layoutparams.wrap_content, layoutparams.wrap_content)); mprofilelayout.addview(tv2, new layoutparams(layoutparams.wrap_content, layoutparams.wrap_content)); mprofilelayout.addview(tv3, new layoutparams(layoutparams.wrap_content, layoutparams.wrap_content)); mprofilelayout.addview(tv4, new layoutparams(layoutparams.wrap_content, layoutparams.wrap_content)); mprofilelayout.addview(tv5, new layoutparams(layoutparams.wrap_content, layoutparams.wrap_content)); 

do have these textviews in xml? if can access them

textview tvx = (textview)findviewbyid(r.id.textviewxid); 

and set text

tvx.settext(string); 

and dont have use mprofilelayout.addview(....);


Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -