我已經創建了自己的文件類型(.mmd)。 這種文件類型我已經保存了一些數據,並且希望當這種類型的文件被選中時,在我的應用程序中打開名爲openMeasurement的子活動。數據文件類型(自定義)不會打開我的應用程序
我的清單已被更改,所以活動具有以下屬性,我從另一個線程獲得了這些屬性。但它似乎不夠用
<activity android:name="OpenMeasurement">
<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="http" android:host="*"
android:pathPattern=".*\\.mmd" />
<data android:scheme="https" android:host="*"
android:pathPattern=".*\\.mmd" />
<data android:scheme="content" android:host="*"
android:pathPattern=".*\\.mmd" />
<data android:scheme="file" android:host="*"
android:pathPattern=".*\\.mmd" />
</intent-filter>
</activity>
我在做什麼錯誤\忘記任何人都可以幫忙嗎? - 預先感謝一堆。
編輯1:
可能是因爲我只在我的真實手機上調試,因此沒有安裝並獲取所有特定要求,真的不應該是這樣,我想就此發表幾點評論你也這麼想。 ------ EDIT3 ---好像它並註冊了「打開文件類型」在手機上,即使在「調試模式」的時候,因爲我可以爲.pdf文件
編輯2註冊它: 好吧,我試圖分裂它,刪除HTTP計劃,因爲我認爲他們沒有必要。 現在的代碼如下所示:
<activity android:name="OpenMeasurement">
<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="content" />
<data android:host="*" />
<data android:pathPattern=".*\\.mmd" />
</intent-filter>
<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:host="*" />
<data android:pathPattern=".*\\.mmd" />
</intent-filter>
</activity>
,它仍然沒有打開,也沒有給予太多的選擇,當我選擇我的文件(使用「我的文件」)
在使用雙逃逸也嘗試在路徑模式(「。* \\。mmd」)中也沒有幫助。
編輯4: 也試圖添加:
<data android:mimetype="*/*"/>
但仍然沒有喜悅:「 - (
謝謝,雖然很煩人,但我希望android可以讓我們在某個時候製作我們自己的mimetypes,這是真正需要imho的功能。 –