1. Are you ready for the Galaxy S20? Here is everything we know so far!

Open Android's default Music App from own Application

Discussion in 'Android Development' started by satellitemundo, Sep 5, 2011.

  1. satellitemundo

    Thread Starter

    Hi Friends,

    I want to open Android's default music app from our own app. I am able to find
    Code (Text):
    1. Intent intent = new Intent(MediaStore.INTENT_ACTION_MUSIC_PLAYER);
    2. startActivity(intent);
    from google. But this is supported for level 8 and up.

    Is there any other way to open music app.

    I can not ignore Android 2.1 version.

    Please Help
     



    1. Download the Forums for Android™ app!


      Download

       
  2. hooked82

    hooked82 Newbie

    I'm not sure of a way to open the default music app, but the following code will give you the list of apps available to play audio files:

    Code (Text):
    1.     Intent intentToPlay = new Intent(Intent.ACTION_VIEW);
    2.     Uri uri = Uri.parse("your_file");
    3.     intentToPlay.setDataAndType(uri, "audio/*");
    4.     startActivity(intentToPlay);
     
    satellitemundo likes this.
  3. satellitemundo

    Thread Starter

    That I know.I what exactly the thing which I explained.
     
Loading...

Share This Page

Loading...