打开PDF在弹出的android [英] open pdf in popup android

查看:101
本文介绍了打开PDF在弹出的android的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

荫开发一个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

这篇关于打开PDF在弹出的android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆