android - Inflate a view to a LinearLayout -


how can inflate other view linearlayout? better show layout first.

list.xml

        <framelayout >              <imageview/>              <progressbar />      </framelayout>            <textview/>      <textview /> 

then , main.xml

    <horizontalscrollview         android:id="@+id/hscrollview"         android:layout_width="wrap_content"         android:layout_height="40dip"         android:layout_margintop="50dip"         android:background="#000000"         android:scrollbars="none" >          <linearlayout             android:id="@+id/linear_temp"             android:layout_width="wrap_content"             android:layout_height="wrap_content"             android:gravity="center_vertical"             android:orientation="horizontal" >         </linearlayout>      </horizontalscrollview> 

so, want list.xml populate linearlayout. data of list.xml json. have spent lot of time changing implementation one.

i've tried doing this: (i first disregard image)

//after parsing json ,  //and doing this..          product = new productrowitem(imageurl, sname, productid, desc, integer.parseint(imgheight), integer.parseint(imgwidth), productownerid);                                 productitems.add(product); //... //by way, product item pojo..           for(productrowitem product : productitems){             view productview = inflater.inflate(r.layout.product_list_layout, null);             holder = new viewholder();             holder.txtproductname = (textview) productview.findviewbyid(r.id.product_name);             holder.txtproductdesc = (textview) productview.findviewbyid(r.id.product_desc);              productview.settag(holder);              holder.txtproductname.settext(product.getproductname());             holder.txtproductdesc.settext(product.getproductdesc());         } 

nothing displayed... ideas regarding inflating linearlayout appreciated. in advance.. also, i've used horizontallistview. , have reason why won't using this. not it's bad, can't override , there's no overscrollby method

you inflate view don't add "productview" created main view or in groupview displayed main view !

your inflate correct (if holder correct)

the holder useless in case because created no inflate layout again, , fill view allocated.

in code : initialize holder inflated view !


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -