前段時間,有一次遇到這個但是忘了記錄下來,今天又遇到,可不能再忘記了。
finalHandler handler =newHandler(context.getMainLooper()) {
@Override
public voidhandleMessage(Message msg) {
}
};
? ? ? ? 使用context.getMainLooper()獲取主線程的looper,但是大神說這個方案有點拆了東墻補西墻的感覺,有可能會導致其他問題。暫時記錄下來。
前段時間,有一次遇到這個但是忘了記錄下來,今天又遇到,可不能再忘記了。
finalHandler handler =newHandler(context.getMainLooper()) {
@Override
public voidhandleMessage(Message msg) {
}
};
? ? ? ? 使用context.getMainLooper()獲取主線程的looper,但是大神說這個方案有點拆了東墻補西墻的感覺,有可能會導致其他問題。暫時記錄下來。