未找到处理Intent的活动-android.Intent.action.OPEN\u文档

未找到处理Intent的活动-android.Intent.action.OPEN\u文档,android,android-intent,android-activity,android-4.4-kitkat,storage-access-framework,Android,Android Intent,Android Activity,Android 4.4 Kitkat,Storage Access Framework,我正在尝试android 4.4的存储访问框架 我开发了一个虚拟应用程序,在活动开始时激发一个意图 Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT); intent.addCategory(Intent.CATEGORY_OPENABLE); startActivityForResult(intent, READ_REQUEST_CODE); 此外,我还开发了另一个虚拟应用程序,作为文件提供商

我正在尝试android 4.4的存储访问框架

我开发了一个虚拟应用程序,在活动开始时激发一个意图

    Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
    intent.addCategory(Intent.CATEGORY_OPENABLE);
    startActivityForResult(intent, READ_REQUEST_CODE);
此外,我还开发了另一个虚拟应用程序,作为文件提供商

        <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.saf"
    android:versionCode="1"
    android:versionName="1.0" >
<uses-sdk
    android:minSdkVersion="19"
    android:targetSdkVersion="19" />

<uses-permission android:name="android.permission.MANAGE_DOCUMENTS"/>

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name="com.example.saf.MainActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

    <provider
        android:name="com.example.saf.MyFileProvider"
        android:authorities="com.example.saf.documents"
        android:exported="@bool/is_kitkat"
        android:enabled="@bool/is_kitkat"
        android:grantUriPermissions="@bool/is_kitkat"
        android:permission="android.permission.MANAGE_DOCUMENTS">
        <intent-filter>
            <action android:name="android.content.action.DOCUMENTS_PROVIDER" />
        </intent-filter>
    </provider>

</application>
我只是在关注android的开发者文档。你知道我做错了什么吗

编辑: 这是我最新的舱单。
我还需要MyFileProvider“extends DocumentsProvider”的“适当”实现吗?我现在可以在函数中返回null吗?

添加一个mime类型,或者简单地添加
intent.setType(“*/*”)

这似乎是一个问题<代码>设置类型()是必需的


编辑:您还需要添加
android:enabled=“true”
,注意您应该从值中引用它,而不是直接引用它,以便仅为>=kitkat启用它。所以
android:enabled=“@bool/is_kitkat”
/res/values/
中的
false
/res/values-v19/
中的
true
要打开所有文件,请添加以下行:

intent.setType("*/*") ;
intent.setType("image/*");
如果需要过滤以显示图像,请添加以下行:

intent.setType("*/*") ;
intent.setType("image/*");
你只要说出你的意图, 像


你的虚拟应用是否使用权限
android.permission.MANAGE_DOCUMENTS
?@SherifelKhatib-实际上它没有该权限。但我添加了它并进行了检查。还是同样的错误,它起作用了!但我仍然无法看到作为提供商工作的我的主机应用。仍然无法看到作为提供商工作的我的主机应用。许多不必要的铸造。。。。您不妨编写
newintent(“android.Intent.action.GET\u CONTENT”).addCategory(Intent.CATEGORY\u OPENABLE).setType(“*/*”)并获得相同的结果,操作要少得多