Skip to content

Commit baa5c74

Browse files
committed
refactor(sample): upgrade api to 1.1.5
1 parent f045c3e commit baa5c74

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

app/src/main/java/com/tinkerpatch/easy_sample/SampleApplication.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,14 @@ private void initTinker() {
7878
TinkerPatch.init(tinkerApplicationLike)
7979
.reflectPatchLibrary()
8080
.setPatchRollbackOnScreenOff(true)
81-
.setPatchRestartOnSrceenOff(true);
81+
.setPatchRestartOnSrceenOff(true)
82+
.setFetchPatchIntervalByHours(3);
8283

8384
// 获取当前的补丁版本
8485
Log.d(TAG, "current patch version is " + TinkerPatch.with().getPatchVersion());
8586

86-
// 每隔3个小时去访问后台时候有更新, 通过 handler 实现轮询的效果
87-
// 默认 setFetchPatchIntervalByHours 只是设置调用的频率限制,并没有去轮询
88-
TinkerPatch.with().startPoll(3);
87+
// 每隔3个小时(通过setFetchPatchIntervalByHours设置)去访问后台时候有更新,通过handler实现轮训的效果
88+
TinkerPatch.with().fetchPatchUpdateAndPollWithInterval();
8989
}
9090
}
9191

0 commit comments

Comments
 (0)