Android development solution for handsets that can't play music _android

Source: Internet
Author: User

This article illustrates the solution to the handset's inability to play music in Android development. Share to everyone for your reference, specific as follows:

This problem makes my egg ache, since Baidu also has the information of wood.

The main reason for the time consuming is because of insufficient permissions, but not terminating the program, with only a small line of log reminders, not seen

It's easy to play with the handset.

Audiomanager.setmode (Audiomanager.mode_in_call)
//set to call

It's still a code thing, but remember to add permissions.


Or it's going to hurt like me.

There is one more thing to be aware of, after the playback is completed

Audiomanager.setmode (Audiomanager.mode_normal);

Otherwise, other software will be playing the handset.

PS: About Android Manifest permission control detailed properties and function instructions can refer to the site online tools:

Android manifest Features and Permissions description Encyclopedia:

For more information on Android-related content readers can view the site: "Android Multimedia operating skills Summary (audio, video, recording, etc.)", "Android graphics and image processing skills summary", "Android Development introduction and Advanced Course", " Android Debugging tips and FAQ Solutions Summary, Android Basic Components usage Summary, Android View overview, the Android layout layout skills Summary, and the Android control usage summary

I hope this article will help you with the Android program.

Related Article

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.