2

I'm working in an Android Webview project and I need to access my device photos and videos, but my buttons doesn't work and I don't receive any error message.

This is my HTML code below:

<strong>Send Photo</strong>
<input type="file" accept="image/*" id="capture" capture="camera" name="txFile">
<br>            
<strong>Send Video</strong>
<input type="file" accept="video/*" id="capture" capture="camcorder" name="txFile2">

This is my Java code:

myWebView.getSettings().setCacheMode(WebSettings.LOAD_DEFAULT);
myWebView.getSettings().setAppCachePath( getApplicationContext().getCacheDir().getAbsolutePath() );
myWebView.getSettings().setAllowFileAccess( true );
myWebView.getSettings().setAppCacheEnabled( true );
myWebView.getSettings().setJavaScriptEnabled( true );
myWebView.getSettings().setDomStorageEnabled(true);
myWebView.addJavascriptInterface(this,"Exemplo");
myWebView.getSettings().setAllowFileAccess(true);
myWebView.getSettings().setCacheMode( WebSettings.LOAD_DEFAULT ); // load online by default

if ( !isNetworkAvailable() ) { // loading offline
    myWebView.getSettings().setCacheMode( WebSettings.LOAD_CACHE_ELSE_NETWORK );
}

This is how to show in Emulator

I appreciate every help on this!

Leonardo Solla
  • 103
  • 1
  • 1
  • 10

0 Answers0