我有一个包含音频文件的URL链接,我想通过我的应用程序共享音频文件。但我收到错误消息,说“共享失败,请重试”
String sharePath = Environment.getExternalStorageDirectory().getPath() + "https://www.admin.bhajandarshana.com/audio/BDIMG15654188363967.mp3";
Uri uri = Uri.parse(sharePath);
Intent share = new Intent(Intent.ACTION_SEND);
share.setType("audio/*");
share.putExtra(Intent.EXTRA_STREAM, uri);
Toast.makeText(MusicPlayerActivity.this, "" + uri, Toast.LENGTH_SHORT).show();
startActivity(Intent.createChooser(share, "Share Sound File"));
答案 0 :(得分:1)
尝试此解决方案:
* thread #19, name = 'com.facebook.react.JavaScript', stop reason = breakpoint 3.1
* frame #0: 0x0000000100c4e6d4 CardioSensys`facebook::react::createNativeModules(modules=104 elements, bridge=0x0000000102d1b8c0, instance=std::__1::shared_ptr<facebook::react::Instance>::element_type @ 0x000000028100e4e0 strong=1 weak=1) at RCTCxxUtils.mm:39:3
frame #1: 0x0000000100bcd840 CardioSensys`::-[RCTCxxBridge _buildModuleRegistryUnlocked](self=0x0000000102d1b8c0, _cmd="_buildModuleRegistryUnlocked") at RCTCxxBridge.mm:520:10
frame #2: 0x0000000100bceb84 CardioSensys`::-[RCTCxxBridge _initializeBridgeLocked:](self=0x0000000102d1b8c0, _cmd="_initializeBridgeLocked:", executorFactory=std::__1::shared_ptr<facebook::react::JSExecutorFactory>::element_type @ 0x0000000283909318 strong=3 weak=1) at RCTCxxBridge.mm:573:36
frame #3: 0x0000000100bce39c CardioSensys`::-[RCTCxxBridge _initializeBridge:](self=0x0000000102d1b8c0, _cmd="_initializeBridge:", executorFactory=std::__1::shared_ptr<facebook::react::JSExecutorFactory>::element_type @ 0x0000000283909318 strong=3 weak=1) at RCTCxxBridge.mm:550:5
frame #4: 0x0000000100bcb498 CardioSensys`::__21-[RCTCxxBridge start]_block_invoke.168(.block_descriptor=0x00000002834686c0) at RCTCxxBridge.mm:344:5
frame #5: 0x0000000100bdefa0 CardioSensys`decltype(__f=0x000000016ff3dc58) block_pointer __strong&>(fp)()) std::__1::__invoke<void () block_pointer __strong&>(&&, decltype(std::__1::forward<void () block_pointer __strong&>(fp)())&&...) at type_traits:4361:1
frame #6: 0x0000000100bdef3c CardioSensys`void std::__1::__invoke_void_return_wrapper<void>::__call<void (__args=0x000000016ff3dc58) block_pointer __strong&>(void () block_pointer __strong&) at __functional_base:349:9
frame #7: 0x0000000100bdef14 CardioSensys`std::__1::__function::__alloc_func<void () block_pointer __strong, std::__1::allocator<std::__1::allocator>, void ()>::operator(this=0x000000016ff3dc60)() at functional:1527:16
frame #8: 0x0000000100bdd6b8 CardioSensys`std::__1::__function::__func<void () block_pointer __strong, std::__1::allocator<std::__1::allocator>, void ()>::operator(this=0x000000016ff3dc58)() at functional:1651:12
frame #9: 0x00000001008722c0 CardioSensys`std::__1::__function::__value_func<void ()>::operator(this=0x000000016ff3dc58)() const at functional:1799:16
frame #10: 0x00000001008709dc CardioSensys`std::__1::function<void ()>::operator(this=0x000000016ff3dc58)() const at functional:2347:12
frame #11: 0x0000000100c4ed98 CardioSensys`facebook::react::tryAndReturnError(func=0x000000016ff3dc58)> const&) at RCTCxxUtils.mm:72:7
frame #12: 0x0000000100bc9e44 CardioSensys`::-[RCTCxxBridge _tryAndHandleError:](self=0x0000000102d1b8c0, _cmd="_tryAndHandleError:", block=0x0000000100bcb434) at RCTCxxBridge.mm:257:20
frame #13: 0x000000018d465690 Foundation`__NSThreadPerformPerform + 336
frame #14: 0x000000018c96ff2c CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
frame #15: 0x000000018c96feac CoreFoundation`__CFRunLoopDoSource0 + 88
frame #16: 0x000000018c96f794 CoreFoundation`__CFRunLoopDoSources0 + 176
frame #17: 0x000000018c96a6d0 CoreFoundation`__CFRunLoopRun + 1004
frame #18: 0x000000018c969fc4 CoreFoundation`CFRunLoopRunSpecific + 436
frame #19: 0x0000000100bc9c8c CardioSensys`::+[RCTCxxBridge runRunLoop](self=RCTCxxBridge, _cmd="runRunLoop") at RCTCxxBridge.mm:249:36
frame #20: 0x000000018d4654a0 Foundation`__NSThread__start__ + 984
frame #21: 0x000000018c5f92c0 libsystem_pthread.dylib`_pthread_body + 128
frame #22: 0x000000018c5f9220 libsystem_pthread.dylib`_pthread_start + 44
frame #23: 0x000000018c5fccdc libsystem_pthread.dylib`thread_start + 4