Java tutorial
//package com.java2s; //License from project: Open Source License import android.content.Context; import android.preference.PreferenceManager; public class Main { public static final String LAYER_FILE_NAME_KEY = "LAYER_FILE_NAME_KEY"; public static boolean setLastLayerFileName(Context context, String fileName) { return PreferenceManager.getDefaultSharedPreferences(context).edit() .putString(LAYER_FILE_NAME_KEY, fileName).commit(); } }