How to call the built-in player

Source: Internet
Author: User

Scenario 1: Enable the built-in player

Intent mintent = new intent (); componentname comp = new componentname ("com. android. music "," com. android. music. musicbrowseractivity "); mintent. setcomponent (COMP); mintent. setaction ("android. intent. action. view "); startactivity (mintent );

Scenario 2: Use the built-in player to open a file

Intent it = new intent (intent. action_view); Uri uri = Uri. parse ("file: // sdcard/song. MP3 "); it. setdataandtype (Uri, "audio/MP3"); startactivity (it );

Note: To enable the system player, it must be Android-native. I did not use Xiaomi in my system. It seems that the native system is better, with fewer vulnerabilities. More and more system vulnerabilities are being beautified.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.