I am developing an application to download pdf file in sd card with the url entered in edittext , after clicking the submit button.
Button b = (Button)findViewById(R.id.button1);
final EditText ed = (EditText)findViewById(R.id.editText1);
b.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
String URL = ed.getText().toString();
WebView web1 =(WebView)findViewById(R.id.webview);
web1.getSettings().setJavaScriptEnabled(true);
web1.loadUrl(URL);
}
});
Below code may help you –
Above code extracted from this Existing project. Don’t forget to give the required permission for
Internet