Я пишу программу Android FTP-сервера. Мне нужно выбрать файлы для отправки клиенту, поэтому мне нужен средство выбора файлов, и я написал этот код:
Java:
Intent filechooser= new Intent(Intent.ACTION_GET_CONTENT);
filechooser.addCategory("*/*");
filechooser.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
startActivityForResult(filechooser, 10);
XML:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.sender">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".Chooser"></activity>
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Я получаю исключение No activity found to handle intent
.