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.content.SharedPreferences;

import android.preference.PreferenceManager;

public class Main {
    private final static String TYPE_PRE = "type_";

    /**
     * @Title: getSettingRingtone
     * @Description: Get current setting ring tone
     * @param context
     * @param type
     * @return
     * @return String
     * @throws
     */
    public static String getSettingRingtone(Context context, int type) {
        SharedPreferences mSharePref = PreferenceManager.getDefaultSharedPreferences(context);
        String value = mSharePref.getString(TYPE_PRE + type, "");
        return value;
    }
}