android - how send audio in raw file via intent -
I have several voice tracks in my app and I want to share them via Bluetooth on another device. I have read all the questions and answers but I still have problems when sending via Bluetooth, the device shows a message -
"file unknown file was not sent."
I do not know what the problem is? Please help me ..
code
public class increases main activity activity {@ override protected crate (saved bundle) InstantState) {super.onCreate (savedInstanceState); SetContentView (R.layout.activity_main); Send Button = (Button) Find VibibIID (R.Butt_Send); Send.setOnClickListener (New OnClickListener () {@Override Click on Public Zero (click V) {// TODO Auto-Generated Method Stub URI imageUri = Uri.parse ("android.resource: // com.example. Intent = new intent (intestine action_snd); intent .setpackage ("com.android.bluetooth"); intent .cet type ("audio / *"); int. Input extra (Intent.EXTRA_STREAM, imageUri); Initialization (intent. Creator (intent, "share"));}}); }}
I have the name of the raw
folder in aaa.mp3
.
file audio = new file ("/ path / to / audio.mp3"); Intent = intent (intent.ACTION_SEND) .setType ("audio / *"); Intent.putExtra (Intent.EXTRA_STREAM, Uri.fromFile (audio)); Beginners (intentions (intention, "share"));
Comments
Post a Comment