android - grid Adapter inside a fragment is not working -
im trying output frm async class , use in grid view in side fragment im sure inputs correct
public void processfinish(movielist output) { string[] movieid=output.getmovieid(); string[] movieimg=output.getmovieid(); boolean response=output.getstatus(); if(response==true){ gridview gridview = (gridview) view.findviewbyid(r.id.gridview_cover); movieadapter = new moviegridadapter(getactivity(), movieimg); gridview.setadapter(movieadapter); }
gridadapter
public view getview(int position, view view, viewgroup viewgroup) { imageview imageview; if(view==null){ imageview= new imageview(mcontext); // imageview.setlayoutparams(new gridview.layoutparams(viewgroup.layoutparams.match_parent,viewgroup.layoutparams.match_parent)); imageview.setscaletype(imageview.scaletype.fit_xy); } else { imageview=(imageview) view; } picasso.with(mcontext).load(image_base_url+imgs[position]).into(imageview); //log.v(moviegridadapter.class.getsimplename(),"http://image.tmdb.org/t/p/w500/"+imgs[position]); return imageview; }
if(view==null){ view = inflater.inflate(r.layout.your_adapter_layout, null); imageview= new imageview(mcontext); // imageview.setlayoutparams(new gridview.layoutparams(viewgroup.layoutparams.match_parent,viewgroup.layoutparams.match_parent)); imageview.setscaletype(imageview.scaletype.fit_xy); }
you not inflating layout gridview, cannot see anything!
Comments
Post a Comment