-1
私はBluetooth
でファイルを共有しています。ファイルは正常に送信されましたが、問題はファイルが完全に送信されたときにイベントを受信できないことです。BluetoothOppLauncherActivityブロードキャストイベントを受信できません
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);
がどのように私は、ファイルの完全な/減少イベントを受け取ることができますように私は
<receiver android:name=".FileSentReceiver"
android:exported="true">
<intent-filter >
<action android:name="android.btopp.intent.action.TRANSFER_COMPLETE"/>
</intent-filter>
</receiver>
とファイルを共有するためのコードとしてAndroidManifest.xml
に受信機を追加したのでしょうか?
を参照してください、それはこれらのイベントは、他のアプリケーションから受信することができないということになります。 –