我想使用Android浏览器意图打开FTP服务器页面

问题描述 投票:0回答:1

我使用以下代码,但应用程序仅以URI崩溃。Parse不知道如何处理ftp:/

Intent intent=new Intent(Intent.ACTION_VIEW, Uri.parse(LinkUrl.get("ftp:/192.168.0.103")));

startActivity(intent);

LOG Cat as as Follows(引发异常的部分:]

2019-12-22 03:04:25.877 8018-8018/com.example.webview E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.example.webview, PID: 8018
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.webview/com.example.webview.MainActivity}: android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=ftp:///... }
android android-intent ftp ftp-client ftpwebrequest
1个回答
1
投票

很少有设备会具有支持ftp方案的应用,因为FTP不受欢迎且不安全。您需要捕获ActivityNotFoundException,并妥善处理用户缺少支持ftp方案的应用的情况。

© www.soinside.com 2019 - 2024. All rights reserved.