我想通過WhatsApp共享一個mp3文件,在意圖上使用ACTION_SEND
方法。問題是不行的。意圖完美地工作,它打開WhatsApp,並允許我選擇任何我想要的聊天。所以我選擇一個(仍然沒有問題),然後點擊發送,這是麻煩開始的地方。Android Studio通過我的應用程序通過whatsapp從我的原始目錄共享mp3-sound
我收到一個彈出消息,指出:
無法共享succesfull,請重試。(德國翻譯) 代碼:
Intent shareIntent = new Intent();
shareIntent.setAction(Intent.ACTION_SEND);
shareIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse("android.resource://com.lmlc.BeckenbauerSoundboard/raw/s01.mp3")); //myuri
shareIntent.setType("audio/mp3");
startActivity(Intent.createChooser(shareIntent, textMsgBoxSendMp3));
我真的希望有人能幫助我這一個。
問題中的代碼已經有'setType(「audio/mp3」)''。 – CommonsWare