コード例 #1
0
  @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;
  }