Back to project page wristband-android.
The source code is released under:
The Artistic License 2.0 Copyright (c) 2014 Allan Pichardo Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed...
If you think the Android project wristband-android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.nimo.wristband.db; /* www . j a v a2 s .c om*/ import android.content.Context; import android.content.SharedPreferences; public class SimpleStorage { public static final String PREFS = "wb_prefs"; public static void putScrollPosition(Context context, int index, int top){ SharedPreferences sharedPreferences = context.getSharedPreferences(PREFS, 0); sharedPreferences.edit().putInt("scroll_index", index).commit(); sharedPreferences.edit().putInt("scroll_top", top).commit(); } public static int getScrollIndex(Context context){ SharedPreferences sharedPreferences = context.getSharedPreferences(PREFS, 0); return sharedPreferences.getInt("scroll_index", 0); } public static int getScrollTop(Context context){ SharedPreferences sharedPreferences = context.getSharedPreferences(PREFS, 0); return sharedPreferences.getInt("scroll_top", 0); } }