-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);
我怎样才能收到文件的完整/下降的事件?
我尝试了这些事件,但仍无法收到,它看起来这些事件不能从其他应用程序接收。 –