Advertisement
Guest User

Untitled

a guest
Apr 12th, 2016
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.51 KB | None | 0 0
  1.  String json = sharedPrefs.getString("buttons", null);
  2.         if (json != null) {
  3.             Type type = new TypeToken<ArrayList<ButtonToNotification>>() {
  4.             }.getType();
  5.             MySingleton.getOurInstance().getButtonToNotifications().clear();
  6.  
  7.             ArrayList<ButtonToNotification> arrayList = gson.fromJson(json, type);
  8.  
  9.             for (int i = 0; i < arrayList.size(); i++) {
  10.                 MySingleton.getOurInstance().getButtonToNotifications().add(arrayList.get(i));
  11.  
  12.             }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement