English 中文(简体)
自动过滤器,从信封中下载附件
原标题:Intent filter to download attachment from gmail apps on Android

我有无意过滤器(ACTION_VIEW)的甲状腺应用,以便打开档案并输入我的申请。 我希望从电子邮件中下载文件附录,以备我的申请。 某些档案类型(即jpg、png、txt)被正确地保存,但有些没有(即:c、xls、ppt)。 我认为,我的活动有正确的意向过滤器,因为它是从其他工具(即投递箱)操作的,而不是用电子邮件传送。 是否有解决办法?

问题回答

I was able to make the download and preview buttons pop up on Android in GMail by removing the scheme data filter in my intent (delete the scheme line and give it a try):

<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="file" />
<data android:mimeType="*/*" />
<data android:pathPattern=".*\.ext" />
<data android:host="*" />
</intent-filter>

然而,根据安的文献,“如果对意向过滤器没有具体规定计划,那么所有其他的URI属性都被忽视”。 由于该计划和《国际权利倡议》的属性被删除,过滤意图的唯一其他途径是使用米梅型,我们都知道,习俗档案延期没有登记过奇米。

参见:

  • scheme://host:port/path
  • pathPrefix
  • pathPattern

因此,没有计划,所有这一切都有所下降。 在发现上述情况后,我尝试了一种明显的做法——即使用一种“办法,甚至试图”......。 两人都没有工作。 我希望其他人能够摆脱我的审判。 但我认为,它必须选择正确的办法。 不幸的是,我知道的唯一计划是:https content and file,而上述任何计划都不是魔弹。

EDIT:

我昨天解决了这个问题。 请见我的解决方案:

<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="application/*" host="*" android:pathPattern=".*.ext" android:scheme="content" />
</intent-filter>

这一意图将产生电子邮件,显示下载次数/预测吨数。 事实上,这也将使你在把卷宗作为附件送交普通电子邮件客户时能够公开。

由于这是与“电子邮件查封意向过滤器”相关的最高级问题之一,我发现,在我的案件中,我没有回答我的调查结果。

为了登记电子邮件的意向,我们需要支持内容计划:

<intent-filter>
    <action android:name="android.intent.action.VIEW" />
    <category android:name="android.intent.category.DEFAULT" />
    <data android:scheme="content" android:mimeType="*" android:host="*" />
</intent-filter>

在我测试的附文中,即使文件在电子邮件中显示,但国际船舶和公司仍然没有文件延期,因此使用和刺roid:PathPattern阻断了接收电子邮件意向。

由于这个事实,登记到所有奇梅 类型是高技能的,我bu倒了内物体的内容(在 Java一侧),发现我的申请文本/解释足够(因此,你的工作是找到适当的 mi,供你应用)。 我最后的意向书认为:

<intent-filter>
    <action android:name="android.intent.action.VIEW" />
    <category android:name="android.intent.category.DEFAULT" />
    <data android:scheme="content" android:mimeType="text/plain" android:host="*" />
</intent-filter>




相关问题
How to upload and download file from a server using C#

I am developing a webpage in that the user can download their Resume for Edit. So I have a link to download the article. I use the following code for download. DataTable dt = user.getUserDetails(2); ...

Detecting PDF Download

I have recently added functionality for generating pdf reports to a web application. However the reports can be quite large and take some time to show the pdf download dialog. I want to show a spinner ...

Writing file to users giving sporadic error in IE

I have a very interesting issue with only specific IE implementations. I have an ASPX page that is used to write files down to the user, as part of the process the page uses the following code to ...

PHP - List of Excel files to download from Intranet Site?

I have a intranet site running PHP 5 that needs to list a folder containing only Excel files. Ideally the user needs to be able to input some search criteria (ie date) and the files would be filtered ...

Determine total size of SVN directory/trunk

Is there a way to count/calculate the total size of a svn directory if you were to checkout a revision? I have limited internet downloads so I need to know how big something is before I go and ...

Scala and html: download an image (*.jpg, etc) to Hard drive

I ve got a Scala program that downloads and parses html. I got the links to the image files form the html, Now I need to transfer those images to my hard drive. I m wondering what the best Scala ...

Downloading file with wxHTTP?

Im really stumped. Im using the wxHTTP class in wxWidgets to try and download two files. The first request succeeds but the second one fails when wxHTTP->GetInputStream is called. Between downloads, ...

热门标签