Java tutorial
//package com.java2s; /** * Copyright 2010 CssWeb Microsystems, Inc. All rights reserved. * CssWeb PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. * * @(#)ActivityUtil.java ?08:07:55 2010-10-3 */ import android.app.Activity; import android.content.Context; import android.content.SharedPreferences; public class Main { public static int getAlarmRecord(Context context) { SharedPreferences sh = context.getSharedPreferences("alarm_record", Activity.MODE_PRIVATE); return sh.getInt("alarmRecord", -1); } }