Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import android.media.RingtoneManager;

import android.provider.Settings;

public class Main {
    /**
     * Gets a specific system string based on a ringtone type
     * @param type The ringtone type
     * @return A string representing the ringtone type
     */
    private static String getStringByType(int type) {
        switch (type) {
        case RingtoneManager.TYPE_ALARM:
            return Settings.System.ALARM_ALERT;
        case RingtoneManager.TYPE_NOTIFICATION:
            return Settings.System.NOTIFICATION_SOUND;
        case RingtoneManager.TYPE_RINGTONE:
            return Settings.System.RINGTONE;
        default:
            return null;
        }
    }
}