0
也許愚蠢的問題,但我不明白...
以下方式之間有區別嗎? 我的意思是浪費內存什麼的?參考自己與獨立子類的回調
class A implements Handler.Callback {
// is it OK to pass the loopback reference into the Handler in this case?
Handler mHandler = new Handler(this);
public boolean handleMessage(Message msg) {
...
}
}
class B {
Handler mHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
...
}
};
}
謝謝!