Android App Close without Error, on click of the first gridview Item -
i have fragment displays gridview images.
@override public view oncreateview(layoutinflater inflater, @nullable viewgroup container, @nullable bundle savedinstancestate) { view v = inflater.inflate(r.layout.hotelgallery, container, false); gridview = (gridview) v.findviewbyid(r.id.gridview); gridadapter = new gridviewadapter(getactivity(), r.layout.grid_item_layout, getdata(getactivity())); gridview.setadapter(gridadapter); gridview.setonitemclicklistener(new onitemclicklistener() { public void onitemclick(adapterview<?> parent, view v, int position, long id) { imageitem item = (imageitem) parent.getitematposition(position); //create intent intent intent = new intent(getactivity(), fullscreenimageactivity.class); intent.putextra("title", item.gettitle()); bytearrayoutputstream bs = new bytearrayoutputstream(); item.getimage().compress(bitmap.compressformat.png, 50, bs); intent.putextra("image", bs.tobytearray()); //start details activity startactivity(intent); } }); return v; }
when item clicked, i'm displaying fullscreen activity image user clicking. above code works when click images except of first. when first item of gridview clicked app closing, without having errors.
any idea that?
Comments
Post a Comment