Esempio n. 1
0
 @Override
 public boolean onFragmentCreate() {
   NotificationCenter.getInstance().addObserver(this, NotificationCenter.closeChats);
   NotificationCenter.getInstance().addObserver(this, NotificationCenter.recentImagesDidLoaded);
   if (selectedAlbum == null) {
     requestQueue = Volley.newRequestQueue(ApplicationLoader.applicationContext);
     if (recentImages.isEmpty()) {
       MessagesStorage.getInstance().loadWebRecent(type);
       loadingRecent = true;
     }
   }
   return super.onFragmentCreate();
 }
  @Override
  public boolean onFragmentCreate() {
    super.onFragmentCreate();

    NotificationCenter.getInstance().addObserver(this, NotificationCenter.FileDidFailedLoad);
    NotificationCenter.getInstance().addObserver(this, NotificationCenter.FileDidLoaded);
    NotificationCenter.getInstance().addObserver(this, NotificationCenter.FileLoadProgressChanged);
    NotificationCenter.getInstance().addObserver(this, NotificationCenter.wallpapersDidLoaded);

    SharedPreferences preferences =
        ApplicationLoader.applicationContext.getSharedPreferences(
            "mainconfig", Activity.MODE_PRIVATE);
    selectedBackground = preferences.getInt("selectedBackground", 1000001);
    selectedColor = preferences.getInt("selectedColor", 0);
    MessagesStorage.getInstance().getWallpapers();
    File toFile =
        new File(ApplicationLoader.applicationContext.getFilesDir(), "wallpaper-temp.jpg");
    toFile.delete();
    return true;
  }