gpt4 book ai didi

java - 为什么最终变量不可检查?

转载 作者:行者123 更新时间:2023-12-01 04:35:43 25 4
gpt4 key购买 nike

我正在重新编写一些代码,使其可以与新的 RootTools 3.0 (which fixes an important bug) 一起使用。 :

我重写的一个部分看起来像这样,带有一个回调类以提高可读性。我添加了两个目录的大小来告知可以清除的浏览器缓存总量:

@Override
protected void onResume() {
super.onResume();
//Refresh views:
try {
//Show browser's cache size:
ShellCommands.getListing("/data/data/com.android.browser/app_databases/", null, new Callback<SumSize>() {
@Override
public void call(SumSize localstore) throws InterruptedException, IOException, TimeoutException, RootDeniedException {
final SumSize total = localstore;
getFirefoxProfiles(new Callback<String>() {
@Override
public void call(String input) throws InterruptedException, IOException, TimeoutException, RootDeniedException {
ShellCommands.getListing(input+"/Cache/", null, new Callback<SumSize>() {
@Override
public void call(SumSize input) {
total.add(input);
((TextView)findViewById(R.id.lblClearBrowser)).setText(total.getReadable());
}
});
}
});
}
});

.waitforfinish 稍微复杂一点,但我在调试时遇到了严重的问题:最里面的调用(SumSize 输入)似乎工作正常,但没有调试时查看总数的方法。这是 Java 中带有 final 外部变量的错误吗?安卓系统中的一个错误? Eclipse 中的错误?

最佳答案

您的变量 View 需要设置为显示常量。您可以从本地菜单的 Java 部分切换此选项。

关于java - 为什么最终变量不可检查?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17397793/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com