我返工一些代碼,使其可與新RootTools 3.0 (which fixes an important bug):爲什麼final變量不可檢查?
一節中,我重寫了看起來像這樣,有回調類更好的可讀性。我添加兩個目錄的大小來告訴總瀏覽器緩存中可能被清除:
@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
外部變量的錯誤? Android中的錯誤? Eclipse中的錯誤?
你可以在'this'中看到什麼?也許你可以找到'this.val $ total' – johnchen902
你的調試集的斷點在哪裏? – luk2302
@ johnchen902你說得對 - 它是'this.val $ total'。你知道爲什麼它不會在鼠標懸停時彈出,或者右鍵單擊顯示 - 檢查? – NoBugs