使用自定义扩展打开和读取文件的内容

时间:2015-01-18 11:00:47

标签: android

我想在我的应用程序中打开一个自定义扩展名为.ccf的文件 并阅读文件的内容。这是一个简单的文本文件没有别的,但我正在更改扩展名,因为我只想我的应用程序阅读它。 我正在使用以下intent-filter打开该文件。但我不知道如何阅读内容。

<intent-filter>
    <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT"/>
        <data android:scheme="http"    android:host="*" android:pathPattern=".*\\.ccf" />
        <data android:scheme="https"   android:host="*" android:pathPattern=".*\\.ccf" />
        <data android:scheme="content" android:host="*" android:pathPattern=".*\\.ccf" />
         <data android:scheme="file"   android:host="*" android:pathPattern=".*\\.ccf" />
</intent-filter>

就像在Adobe Reader中打开.PDF文件一样。 需要帮助。

0 个答案:

没有答案