private final MHandler mHandler = new MHandler(this);
private static class MHandler extends Handler {
private final WeakReference<MainActivity> mActivity;
public MHandler(MainActivity activity) {
mActivity = new WeakReference<MainActivity>(activity);
}
@Override
public void handleMessage(Message msg) {
MainActivity activity = mActivity.get();
}
}
handler警告
最新推荐文章于 2023-06-25 11:08:15 发布