-1
我正在通過Bluetooth
共享文件。文件已成功發送,但問題是我無法收到文件完全發送時的任何事件。我已經加入接收機AndroidManifest.xml
作爲無法接收BluetoothOppLauncherActivity廣播事件
<receiver android:name=".FileSentReceiver"
android:exported="true">
<intent-filter >
<action android:name="android.btopp.intent.action.TRANSFER_COMPLETE"/>
</intent-filter>
</receiver>
和代碼共享文件如下:
File file = new File(Environment.getExternalStorageDirectory() + "/Download/file_to_sent.txt");
Intent sharingIntent = new Intent(android.content.Intent.ACTION_SEND);
sharingIntent.setType("text/plain");
sharingIntent.setComponent(new ComponentName("com.android.bluetooth", "com.android.bluetooth.opp.BluetoothOppLauncherActivity"));
sharingIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(file));
startActivity(sharingIntent);
我怎樣才能收到文件的完整/下降的事件?
我嘗試了這些事件,但仍無法收到,它看起來這些事件不能從其他應用程序接收。 –