Skip to content

Instantly share code, notes, and snippets.

@SeanPONeil
Created March 27, 2013 14:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SeanPONeil/5254606 to your computer and use it in GitHub Desktop.
Save SeanPONeil/5254606 to your computer and use it in GitHub Desktop.
Sort Method for NodeCommentFragment
public void sort(String type){
SharedPreferences prefs = getActivity().getSharedPreferences(
getActivity().getPackageName(), Context.MODE_PRIVATE);
if(type.equals(ASC)){
prefs.edit().putString(SORT, ASC).commit();
} else {
prefs.edit().putString(SORT, DESC).commit();
}
getActivity().invalidateOptionsMenu();
getActivity().getSupportLoaderManager().restartLoader(0, null, this);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment