Hello I'm developing app to open pdf files in webview in pdfactivity. I tried opening through intent its redirecting to system inbuilt apps but not pdfactivity.java. find the code below, I declared this in my webview activity,
private class MyWebViewClient extends WebViewClient {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
Uri uri = WebvActivity.this.getIntent().getData();
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(uri, "application/pdf");
intent.putExtra(PdfActivity.EXTRA_PDFFILENAME, "url");
startActivity(intent);
return super.shouldOverrideUrlLoading(view, url);
}
I'm using PdfViewer.jar library, In README text it is mentioned use
Intent intent = new Intent(this, WebviewActivity.class);
intent.putExtra(PdfViewerActivity.EXTRA_PDFFILENAME, "PATH TO PDF GOES HERE");
startActivity(intent);
How can I get URL of pdf files from the webpage in webview & load them in PdfActivity. See below link for your reference, https://sourceforge.net/p/andpdf/code/HEAD/tree/tag/Beta_0_1_11/AndroidPdfViewer/activitysrc/net/sf/andpdf/