android - Nothing happens after picking file via Intent.ACTION_GET_CONTENT -
i'm trying pick video phone storage , playing using videoview. here code how tried it.
videoview vvvideo; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); vvvideo = (videoview)findviewbyid(r.id.vvvideo); intent intent = new intent(intent.action_get_content); intent.settype("video/*"); intent.putextra(intent.extra_local_only, true); startactivityforresult(intent , 11); } @override protected void onactivityresult(int requestcode, int resultcode, intent data) { if (resultcode == -1){ if (requestcode == 11) { vvvideo.setvideouri(data.getdata()); vvvideo.start(); } } } problem every time i'm picking in file_manager_activity restarts(i think so),and goes on , on. tried debug , process did't go onactivityresult. after reopen app , picking file may work first try,may work second. it's random can't find pattern , mistake. sorry english , please help,cause don't know do.
Comments
Post a Comment