android - Upload photo from gallery or take from camera in Webview -
my application webbased , need upload photos, website have file input button, made work
wv = new webview(this); wv.setwebviewclient(new webviewclient()); wv.getsettings().setjavascriptenabled(true); wv.getsettings().setallowfileaccess(true); wv.setwebchromeclient(new webchromeclient() { public void openfilechooser(valuecallback<uri> uploadmsg, string accepttype, string capture){ muploadmessage = uploadmsg; intent = new intent(intent.action_get_content); i.addcategory(intent.category_openable); i.settype("image/*"); mainactivity.this.startactivityforresult( intent.createchooser( i, "file chooser" ), mainactivity.filechooser_resultcode ); }
but shows gallery pick photos, need take camera @ same time.
i tried solution upload camera photo , filechooser webview input field opening camera, not uploading taken photo
in example
wv.setwebviewclient(new webviewclient() { public boolean shouldoverrideurlloading(webview v, string url) { if (url.startswith("testzapp:")) { //do whatever action had intended } } }
Comments
Post a Comment