1

我浏览了所有帖子,但它对我不起作用。请帮忙。

我正在网络视图中打开我的电子邮件帐户。所以我想要打开附件的能力。

 wvA.setDownloadListener(new DownloadListener()
        {
            public void onDownloadStart(String url, String userAgent, String contentDisposition, String mimeType,
                    long size)
            {
                Intent viewIntent = new Intent(Intent.ACTION_VIEW);
                viewIntent.setDataAndType(Uri.parse(url), mimeType);

                try
                {
                    Log.i("Testing", "onDownloadStart");
                    startActivity(viewIntent);
                }
                catch (ActivityNotFoundException ex)
                {
                    Log.w("Testing", "Couldn't find activity to view mimetype: " + mimeType);
                }
            }
        });
4

0 回答 0