package com.example.sp;
import android.content.Context;
import android.content.SharedPreferences;
public class Sp {
public static void set(Context context,String key,int id){
SharedPreferences sp = context.getSharedPreferences("info",0);
sp.edit().putInt(key, id).commit();
}
public static int get(Context context,String key,int id){
SharedPreferences sp = context.getSharedPreferences("info", 0);
return sp.getInt(key, id);
}
}
import android.content.Context;
import android.content.SharedPreferences;
public class Sp {
public static void set(Context context,String key,int id){
SharedPreferences sp = context.getSharedPreferences("info",0);
sp.edit().putInt(key, id).commit();
}
public static int get(Context context,String key,int id){
SharedPreferences sp = context.getSharedPreferences("info", 0);
return sp.getInt(key, id);
}
}