2017-02-14 2 views
-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에 수신기를 추가 한입니까?

답변

0

사실, ACTION_BT_OPP_TRANSFER_DONE에 BroadcastReceiver를 등록한 다음 EXTRA_BT_OPP_TRANSFER_STATUS 여분을 확인하고 성공 또는 실패했는지 확인해야합니다.

이들은 공개 API &의 일부로 보입니다. 다음 버전에서 변경 될 수 있습니다.

세부 사항은 아직도받을 수 없습니다 이러한 이벤트를 시도했지만 한 here

+0

를 참조하십시오, 그것은 이러한 이벤트는 다른 응용 프로그램에서 수신 할 수없는 것으로 보인다. –

관련 문제