android - how to add Runtime ImageViews into linearlayout -
i getting runtime imageviews,how can add imageviews 1 single linear layout.
linearlayout linearlayout=new linearlayout(this); linearlayout.setorientation(linearlayout.horizontal); linearlayout.layoutparams vp=new linearlayout.layoutparams(layoutparams.wrap_content,layoutparams.wrap_content); imageview imageview= new imageview(this); imageview.setimagebitmap(bitmap); imageview.setvisibility(view.visible); imageview.setbackgroundcolor(0xffff00ff); //linearlayout=linearlayout+imageview; linearlayout.layoutparams iv=new linearlayout.layoutparams(layoutparams.wrap_content,layoutparams.wrap_content); linearlayout.setlayoutparams(iv); linearlayout.addview(imageview); setcontentview(linearlayout,vp);
linearlayout linearlayout=new linearlayout(this); linearlayout.setorientation(linearlayout.horizontal); linearlayout.layoutparams vp=new linearlayout.layoutparams(layoutparams.wrap_content,layoutparams.wrap_content); imageview imsex = new imageview(context); addview(imsex,linearlayout);
Comments
Post a Comment