Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android launching music player using intent

Tags:

android

Is it possible to open the music app from my app in android, or is it best to write a whole new music app inside of mine. I would rather use theirs since the user will already be comfortable with it.

like image 502
shaneburgess Avatar asked Jun 24 '10 22:06

shaneburgess


People also ask

Is Intent deprecated?

The Intent is not deprecated the problem is with your itemClickable. class because it is not recognized.

What is Android Intent action?

An Intent is a messaging object you can use to request an action from another app component. Although intents facilitate communication between components in several ways, there are three fundamental use cases: Starting an activity. An Activity represents a single screen in an app.

How do I play music on Android?

On your Android phone or tablet, say "Hey Google, open Assistant settings." Or, go to Assistant settings. Tap Music. Choose a music service.

What is Intent provider in Android?

Android Intent is the message that is passed between components such as activities, content providers, broadcast receivers, services etc. It is generally used with startActivity() method to invoke activity, broadcast receivers etc.


1 Answers

I found one way to do this.

Intent intent = new Intent();   intent.setAction(android.content.Intent.ACTION_VIEW);   intent.setDataAndType(Uri.parse(YOUR_SONG_PATH), "audio/*");   startActivity(intent); 
like image 133
shaneburgess Avatar answered Sep 30 '22 15:09

shaneburgess