Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
junaiiiid opened this issue Dec 1, 2018 · 2 comments

Comments

@junaiiiid
Copy link

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.

@kkshitij-agrawal
Copy link

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

@iamyashh
Copy link

iamyashh commented Feb 19, 2019

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants