import psutil
obj_Disk = psutil.disk_usage('/')
print (obj_Disk.total / (1024.0 ** 3))
print (obj_Disk.used / (1024.0 ** 3))
print (obj_Disk.free / (1024.0 ** 3))
print (obj_Disk.percent)
内的this.getApplication()).setQuery(query);
和第二个onQueryTextSubmit
。为什么放HomeActivity.this.getApplication()
它不会确认错误,但也不会访问最后query
中loadFirstPage
的值?
((MyApplication) this.getApplication()).setQuery(null);
// listening to search query text change
searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
@Override
public boolean onQueryTextSubmit(String query) {
// loadFirstPage(builder,query);
((MyApplication) HomeActivity.this.getApplication()).setQuery(query);
return false;
}
@Override
public boolean onQueryTextChange(String query) {
// loadFirstPage(builder,query);
((MyApplication) HomeActivity.this.getApplication()).setQuery(query);
return false;
}
});
String s = ((MyApplication) this.getApplication()).getQuery();
loadFirstPage(builder,s);
return true;
}
提前致谢