Hi All,

I want to check while playing song want to make call and need to check
music is resuming.

please find my code below.

//scannedFiles is an ArrayList object as entire list of songs there in
phone.

playMusic(){
int val = randomMusic.nextInt(scannedFiles.size());
Uri data = Uri.parse("file://"+
scannedFiles.get(val).getAbsolutePath());
intent.setDataAndType(data, "audio/mp3");
startActivity(intent);
try {
 Thread.sleep(5000);
  makeCall();
} catch (InterruptedException e) {
  e.printStackTrace();
}}

makeCall(){
try {
        Intent call = new Intent(Intent.ACTION_CALL);
        call.setData(Uri.parse("tel:1234"));
        startActivity(call);
    } catch (ActivityNotFoundException e) {
        Log.e("MakeCall", ""+e.toString());
    }
}

Music is playing and call is not initiating unless we focus phone
application by pressing back button.

if anyone know the solution
please help me out .

Regards,
Bharathiraja R

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to