是否可以在全屏 Android Activity 中覆盖用于显示通知栏和返回卡控制按钮的向下滑动手势?
我正在开发一个婴儿防护应用程序,有时婴儿会向下滑动屏幕并退出应用程序(通过点击通知或主页按钮)。例如,我想将手势从向下滑动更改为点击某个区域或三次点击屏幕。是否可以?
使用 curator 时treeCache,如何确保缓存已准备好?
之后cache.start(),如果我立即调用getCurrentData,它将返回null,那么我如何确保缓存已准备好?,有人可以给我一个例子吗?谢谢
client = CuratorFrameworkFactory.builder()
.connectString(connectionString)
.retryPolicy(new ExponentialBackoffRetry(zkConnectionTimeoutMs, 3))
.sessionTimeoutMs(zkSessionTimeoutMs)
.build();
client.start();
cache = new TreeCache(client, rootPath);
cache.start();
ChildData child = cache.getCurrentData(rootPath); // child is null
Thread.sleep(50); // must sleep for a while
child = cache.getCurrentData(rootPath); // child is ok
Run Code Online (Sandbox Code Playgroud)