-1
我想添加我的torrent文件在SD卡上安装洪流应用程序(uTorrent,BitTorrent)。我已经制作了我自己的文件选取器活动,并在其中显示文件。当用户点击任何文件时,如果安装了超过1个torrent应用程序,则显示建议,否则添加可用的torrent应用程序。一切正常。它显示了当安装了超过1个应用程序时的建议,并且在仅安装了1个应用程序的情况下也启动了可用应用程序。但问题是应用程序启动时显示“无法添加”文件路径“”。以下是我的代码。添加文件到可用的洪流应用程序android
Intent i = new Intent(Intent.ACTION_VIEW);
i.addCategory(Intent.CATEGORY_DEFAULT);
File file123 = new File(seleFile.getAbsolutePath());
MimeTypeMap map = MimeTypeMap.getSingleton();
String ext = MimeTypeMap.getFileExtensionFromUrl(file123.getName());
String type = map.getMimeTypeFromExtension(ext);
Uri data = Uri.fromFile(file123);
i.setDataAndType(data, type);
startActivity(Intent.createChooser(i, "Select Application"));
请帮助我。