I tried to find some solutions to the problem. But there are only codes that download a specific file.
I have a website that opens in a webview. There are several PDFs on the page. I need a code that will download or display the files.
Here is the code I'm using for webview:
public class EnvironmentAula extends Activity {
private WebView webViewAmbienteAula1;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.activity_ambiente_aula);
String url = "http://www.meusite.com";
WebView view = (WebView)
this.findViewById(R.id.webViewAmbienteAula);
view.setWebViewClient(new WebViewClient());
view.getSettings().setJavaScriptEnabled(true);
view.loadUrl(url);
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event){
WebView view = (WebView)
this.findViewById(R.id.webViewAmbienteAula);
if ((keyCode == KeyEvent.KEYCODE_BACK) && view.canGoBack()){
view.goBack();
return true;
}
return super.onKeyDown(keyCode, event);
}
}