自定义文件类型的机器人不工作 [英] Custom Filetype in Android not working

查看:161
本文介绍了自定义文件类型的机器人不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在写一个Android应用程序,它应该打开的文件,并结束.meetme

I'm currently writing an Android App and it should open Files with the ending .meetme

其实应该从Gmail中直接打开他们,但我不认为这是可能的。

Actually it should open them directly from Gmail, but I don't think that is possible.

这是我的Andr​​oidManifest.xml中的code:

This is the Code of my AndroidManifest.xml:

<activity android:name=".MeetingRequest" android:label="Meeting Request">
    <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:host="*" />
        <data android:pathPattern=".*\\.meetme" />
    </intent-filter>
</activity>

我已经尝试了不少的变化,如果我在天文机智下龙湾点击打开该文件,并打开文字,我的应用程序显示出来,并且可以正常打开。 将不胜感激任何帮助。

I've tried quite a few variations, if I open the file in Astro wit h a long click and open as text, my app shows up and can open it normally. Would be grateful for any help.

马库斯

推荐答案

大量的试验和错误,并读取几乎所有我能找到后,这里就是终于为我工作:

After a lot of trial and error and reading nearly everything I could find, here's what finally worked for me:

    <activity android:name=".DrawActivity"
              android:screenOrientation="portrait"
              android:label="@string/app_name">
        <intent-filter>
            <action android:name="android.intent.action.MAIN"/>
            <category android:name="android.intent.category.LAUNCHER"/>
        </intent-filter>
        <intent-filter>
            <action android:name="android.intent.action.VIEW"/>
            <action android:name="android.intent.action.EDIT"/>
            <category android:name="android.intent.category.DEFAULT"/>
            <data android:pathPattern="*.snowdragon"/>
            <data android:mimeType="text/snowdragon"/>
        </intent-filter>
    </activity>

这篇关于自定义文件类型的机器人不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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