Android Open Source - EasyFeeds View Pager Data Recover






From Project

Back to project page EasyFeeds.

License

The source code is released under:

This is free and unencumbered software released into the public domain. Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a co...

If you think the Android project EasyFeeds listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.manustudios.easyfeeds;
// w  w w . j  av  a 2s .co m
import android.content.Context;
import android.content.SharedPreferences;

public class ViewPagerDataRecover {

  private final String KEY_POS_PREFS ="positionPrefskey";
  private final String KEY_PREFS_GROUP_POSITION = "mainScreenViewPagerGroupPos";
  private final String KEY_PREFS_CHILD_POSITION = "mainScreenViewPagerChildPos";
  
  private SharedPreferences positionPrefs;
  public ViewPagerDataRecover(Context context){
    positionPrefs = context.getSharedPreferences(KEY_POS_PREFS, Context.MODE_PRIVATE);
  }
  
  public void setLastGroupPos(int groupPos){
    SharedPreferences.Editor editor = positionPrefs.edit();
    editor.putInt(KEY_PREFS_GROUP_POSITION, groupPos);
    editor.commit();
  }
  public void setLastChildPos(int childPos){
    SharedPreferences.Editor editor = positionPrefs.edit();
    editor.putInt(KEY_PREFS_CHILD_POSITION, childPos);
    editor.commit();
  }
  
  public int getLastGroupPos(){
    return positionPrefs.getInt(KEY_PREFS_GROUP_POSITION, 0);
  }
  
  public int getLastChildPost(){
    return positionPrefs.getInt(KEY_PREFS_CHILD_POSITION, 0);
  }
}




Java Source Code List

com.manustudios.adapters.MainScreenAdapter.java
com.manustudios.adapters.SavedTopicAdapter.java
com.manustudios.adapters.SubTopicAdapter.java
com.manustudios.adapters.TopicAdapter.java
com.manustudios.easyfeeds.MainActivity.java
com.manustudios.easyfeeds.MainWebActivity.java
com.manustudios.easyfeeds.ScreenPagerFragment.java
com.manustudios.easyfeeds.SearchPostsTask.java
com.manustudios.easyfeeds.ViewPagerDataRecover.java