1. Download our Official Android App: Forums for Android!

Apps Open Android's default Music App from own Application

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

  1. satellitemundo

    Thread Starter
    Rank:
    None
    Points:
    15
    Posts:
    29
    Joined:
    Aug 18, 2010

    Aug 18, 2010
    29
    0
    15
    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
     

    Advertisement

  2. hooked82

    hooked82 Newbie
    Rank:
    None
    Points:
    16
    Posts:
    19
    Joined:
    Jul 23, 2011

    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
    Rank:
    None
    Points:
    15
    Posts:
    29
    Joined:
    Aug 18, 2010

    Aug 18, 2010
    29
    0
    15
    That I know.I what exactly the thing which I explained.
     

Share This Page

Loading...