Android Intent didn't start automatically -



Android Intent didn't start automatically -

i'm creating application android implement baseadapter gridview , tabfragment create sweepable application. problem when click object in grid, intent doesn't start automatically. must swipe screen other fragment, fragment before start intent. did know problem? sample code gridadapter

@override public view getview(final int position, view convertview, viewgroup parent){ final pdfviewer pdf = new pdfviewer(); if (convertview == null){ imageview = new imagebutton(_activity); } else { imageview = (imagebutton) convertview; } bitmap image = decodefile(_imgpaths.get(position), imagewidth, imageheight); imageview.setscaletype(imageview.scaletype.center_crop); imageview.setlayoutparams(new gridview.layoutparams(imagewidth, imageheight)); imageview.setimagebitmap(image); imageview.setonclicklistener(new onimageclicklistener(position)); homecoming imageview; } class onimageclicklistener implements onclicklistener { int _postion; public onimageclicklistener(int position) { this._postion = position; } @override public void onclick(view v) { file file = new file(_filepaths.get(_postion)); uri path = uri.fromfile(file); intent = new intent(intent.action_view); i.setdataandtype(path, "application/pdf"); i.setflags(intent.flag_activity_clear_top); _activity.startactivity(i); } }

android android-intent android-fragments

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -