使用已安装的文件编辑器(如果有)编辑纯文本文件的意图

Ped*_*yoo 10 android plaintext android-intent

我希望我的应用程序打开一个纯文本文件,我的终端上安装了任何文件编辑器,但我不断收到此异常:

ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.EDIT dat=file:///sdcard/folder/file.txt } 
Run Code Online (Sandbox Code Playgroud)

首先我认为我没有安装文件编辑器,但如果我使用ASTRO文件管理器,我可以使用"文件编辑器"和"QuickOffice"打开文件,所以我认为问题是我没有使用正确的代码......

这是代码

Intent intent = new Intent(Intent.ACTION_EDIT); 
Uri uri = Uri.parse("file:///sdcard/folder/file.txt"); 
intent.setDataAndType(uri, "plain/text"); 
startActivity(intent);
Run Code Online (Sandbox Code Playgroud)

更令人惊讶的是,如果我使用不存在的文件的路径,它会不断引发相同的异常......

谢谢

Com*_*are 14

MIME类型是text/plain.