处理MIME类型是在Android的浏览器POST的结果是在、浏览器、类型、结果

2023-09-06 06:46:17 作者:住进你心里

我有一个成功的MIME类型,其中我感兴趣调用的活动。从服务器发送的内容是创建作为POST的结果的XML文档。我试图处理结果两种不同的方式,我没有运气,或者:

I have an Activity that is successfully invoked for the MIME type in which I'm interested. The content being sent from the server is an XML document created as the result of a POST. I've tried to process the result two different ways and I'm not having luck with either:

机器人:MIMETYPE =应用/ customapp这样做,我的活动运行,但我从Intent.getData得到()的URI是用于后期的URL。调用到getContentResolver()openInputStream()导致的 java.io.FileNotFoundException:没有内容提供商:HTTP:// .... 的很明显,只是击中该网址不会因为我不工作'T有发布的数据。 机器人:pathPattern =。* \ custom.app URL的最后一部分是custom.app,所以我尝试使用一个路径模式。这样一来,浏览器尝试下载该文件,以下两种情况之一发生:该股浏览器尝试下载无题和失败。歌剧下载文件,命名它为希望,并会提供打开该文件,这工作,但Opera Mini的什么也不做,但下载的文件。 android:mimeType="application/customapp" Doing this, my activity runs, but the URI I get from Intent.getData() is the URL used for the post. A call to getContentResolver().openInputStream() results in java.io.FileNotFoundException: No content provider: http://.... Obviously, just hitting that URL won't work as I don't have the posted data. android:pathPattern=".*\custom.app" The last segment of the URL is custom.app, so I tried using that with a path pattern. This way, the browser attempts to download the document and one of two things happens: The stock browser attempts to download "untitled" and fails. Opera downloads the document, naming it as hoped, and will offer to open the file, which works, but Opera Mini does nothing but download the file.

下面是我的表现与计划中的相关章节:

Here is the relevant section of my manifest with the scheme in:

<application android:icon="@drawable/icon" android:label="@string/app_name">
    <activity android:name=".CustomappActivity" android:label="@string/app_name">
        <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:mimeType="application/customapp" />
            <data android:scheme="http" />
            <data android:scheme="https" />
        </intent-filter>
    </activity>
</application>

我想使用第一个选项,但会与第二竖起即使它需要歌剧院,但只有当它横跨歌剧的两个版本曾一致。我只是不明白的方式来获得结果的输入流从服务器发送。

I'd like to use the first option, but could put up with the second even if it required Opera, but only if it worked consistently across both versions of Opera. I just can't see a way to get an input stream for the result being sent from the server.

推荐答案

我会回答我的问题。很显然,我搞砸了。还有就是与股票浏览器,并将其与下载管理器交互的方式一个已知的问题。此时,就不能检索发送作为HTTP POST的结果文档。该缺陷是这里详细

I'll answer my own question. Apparently, I'm screwed. There is a known issue with the stock browser and the way it interacts with the download manager. At this time, it cannot retrieve documents that are sent as the result of an HTTP POST. The bug is detailed here