打开PDF在弹出的android在弹出、PDF、android

2023-09-04 04:10:37 作者:归路

荫开发一个Android应用程序,在这里我需要在弹出的窗口中打开我的PDF文件。 我的code是:

Iam developing an Android app, where i need to open my pdf file in popup window. My code is:

 ImageView brobutton=(ImageView)layout.findViewById(R.id.imageView3);
                                        brobutton.setOnClickListener(new OnClickListener() {


                                                   }
                                                });

我已经开发了一个应用程序在仿真器打开PDF本code:

Already I have developed a app to open pdf in emulator with this code:

 final String googleDocsUrl = "http://docs.google.com/viewer?url=";

                                                WebView mWebView=new WebView(SubProducts.this);

                                                mWebView.getSettings().setJavaScriptEnabled(true);
                                                WebSettings webSettings = mWebView.getSettings();
                                                webSettings.setPluginState(PluginState.ON);

                                                mWebView.setWebViewClient(new WebViewClient() {
                                                    public boolean shouldOverrideUrlLoading(WebView view, String url){

                                                        view.loadUrl(image_urlpdf);
                                                        return false; // then it is not handled by default action
                                                   }
                                                });


                                                mWebView.loadUrl((googleDocsUrl + image_urlpdf));

按钮,我需要打开我的pdf.Any之一的onclick下,建议我有良好的idea.thanks提前。

under the onclick of button I need to open my pdf.Any one suggest me with good idea.thanks in Advance.

推荐答案

您需要修改你的应用程序来打开PDF文件。无论是使用意图,以提醒您的应用程序需要打开弹出用于显示PDF通过一些标志。

You need to modify your app to open PDF. Either pass some flag using intents to alert that your app need to open popup for showing PDF.

检查该线程如何显示作为对话 Android的活动作为一个对话框

Check this thread for how to show activity as dialog Android Activity as a dialog