Fit のバージョンアップ(1.1.0)を行いました。
今回の修正では、新しいアノテーションを導入し、アプリケーションのバージョンアップ時のみメソッドが実行されるように表明することができるようになります。
public class MyModule implements VersionModule { @VersionCode({1, 2, 3}) // foo() is called when the app is updated to version code = 1, 2 and 3 public void foo() { } @VersionCode(4) @UpgradeOnly // bar() is called when the app is updated to version code = 4, and not called when the app is newly installed public void bar() { } }
foo()
は新規インストール時でもバージョンアップ時でも実行されますが、bar()
はバージョンコード4
にバージョンアップした時のみ実行されます。