Method of audiomanager volume class in Android

Source: Internet
Author: User
ArticleDirectory
  • Learn about audiomanager
  • Introduction to audiomanager

 

Learn about audiomanager

The audiomanager class is located in the Android. Media package, which provides operations to control the volume and audible mode.

 

Introduction to audiomanager

There are too many methods for mail to audiomanager. Here are only a few common methods:

Method: adjustvolume (INT direction, int flags)
Explanation: This method is used to control the volume of the mobile phone when the first parameter is audiomanager. when adjust_lower is used, you can reduce the volume by one unit and transfer it to audiomanager. when adjust_raise is used, you can increase the volume by one unit.

Method: getmode ()
Explanation: The current audio mode is returned.

Method: getringermode ()
Explanation: The current ringtone mode is returned.

Method: getstreamvolume (INT streamtype)
Explanation: Obtain the current mobile phone volume. The maximum value is 7 and the minimum value is 0. When the value is 0, the mobile phone automatically adjusts the mode to "vibrate ".

Method: setringermode (INT ringermode)
Explanation: Change the ringtone mode.

Note: QQ technology exchange group: add one if you are interested in 108614806.

 

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: info-contact@alibabacloud.com 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.