以下のコードを見てください: このようなハンドラーを使用すると、警告が表示されます (このハンドラー クラスは静的である必要があります。そうしないと、リークが発生する可能性があります)。
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;