请看下面的代码:当我使用这样的处理程序时,我收到一个警告(这个处理程序类应该是静态的,否则可能会发生泄漏)有人能告诉我最好的方法是什么吗?
private void cacheImages() {
try {
// The handler is inside the function because
// normally this function is called once.
final Handler cacheHandler = new Handler() {
public void handleMessage(Message message) {
switch (message.what) {
case ThreadState.STARTED:
cachingDialog.setMax(message.arg1);
break;
case ThreadState.PROGRESSION_UPDATE:
cachingDialog.setProgress(message.arg1);
break;