Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import android.content.Context;

import android.provider.Settings;

public class Main {

    public static boolean setMediaVolume(Context context, int mediaVloume) {
        if (mediaVloume < 0) {
            mediaVloume = 0;
        } else if (mediaVloume > 15) {
            mediaVloume = mediaVloume % 15;
            if (mediaVloume == 0) {
                mediaVloume = 15;
            }
        }
        return Settings.System.putInt(context.getContentResolver(), "volume_music", mediaVloume);
        //            Settings.System.VOLUME_MUSIC, mediaVloume);
    }
}