SoFunction
Updated on 2025-04-06

Solutions to the handset not being able to play music in Android development

This article describes the solution to the inability to play music in Android development. Share it for your reference, as follows:

This question hurts me, since Baidu doesn’t have any information.

The main reason for the time-consuming is that when the permissions are insufficient, the program is not terminated. Only a small line of log reminder was used, and no

Playing with a handset is easy

(AudioManager.MODE_IN_CALL)
//Set as in the call

It's still the same thing as this code, but remember to add permissions

.MODIFY_AUDIO_SETTINGS

Otherwise, it will be as painful as me for a long time

There is another thing to note, you need to be after the playback is completed

(AudioManager.MODE_NORMAL);

Otherwise, the other software will make the phone sound

PS: For detailed attributes and function descriptions of Android Manifest permission control, please refer to the online tools of this site:

Android Manifest function and permission description:
http://tools./table/AndroidManifest

For more information about Android related content, please check out the topic of this site:Android multimedia operation skills summary (audio, video, recording, etc.)》、《Summary of Android graphics and image processing skills》、《Android development introduction and advanced tutorial》、《Android debugging skills and solutions to common problems》、《Summary of the usage of basic Android components》、《Android View View Tips Summary》、《Android layout layout tips summary"and"Android control usage summary

I hope this article will be helpful to everyone's Android programming design.