Skip to content

How to Play music in Google Play music or any media player app by pressing a button in activity of your app? #45

Open

Description

@junaiiiid

Hi, I'm making an app with a music widget it has the following buttons.
Play, Pause, Previous track and Next track.
how do I play music in the google play music app just by pressing the play button?
any help would be appreciated thankyou.

Activity

  1. kkshitij-agrawal commented on Dec 26, 2018

    @kkshitij-agrawal

    If you're building the app using the android studio, you will have to activate the mediaplayer service ie, music playing in the background.

  2. iamyashh commented on Feb 19, 2019

    @iamyashh

    You can try something of this sort,
    Intent intent = context.getPackageManager().getLaunchIntentForPackage("com.google.android.music");
    startActivity(intent);
    This would directly take you to the Google Play Music App. Hope this helps you @junaiiiid .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions