Merge "Clean up StaticInnerHandlerWrapper a bit" into jb-mr2-dev
This commit is contained in:
commit
f0864b1d95
1 changed files with 7 additions and 7 deletions
|
@ -22,17 +22,17 @@ import android.os.Looper;
|
||||||
import java.lang.ref.WeakReference;
|
import java.lang.ref.WeakReference;
|
||||||
|
|
||||||
public class StaticInnerHandlerWrapper<T> extends Handler {
|
public class StaticInnerHandlerWrapper<T> extends Handler {
|
||||||
final private WeakReference<T> mOuterInstanceRef;
|
private final WeakReference<T> mOuterInstanceRef;
|
||||||
|
|
||||||
public StaticInnerHandlerWrapper(T outerInstance) {
|
public StaticInnerHandlerWrapper(final T outerInstance) {
|
||||||
super();
|
this(outerInstance, Looper.myLooper());
|
||||||
if (outerInstance == null) throw new NullPointerException("outerInstance is null");
|
|
||||||
mOuterInstanceRef = new WeakReference<T>(outerInstance);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public StaticInnerHandlerWrapper(T outerInstance, Looper looper) {
|
public StaticInnerHandlerWrapper(final T outerInstance, final Looper looper) {
|
||||||
super(looper);
|
super(looper);
|
||||||
if (outerInstance == null) throw new NullPointerException("outerInstance is null");
|
if (outerInstance == null) {
|
||||||
|
throw new NullPointerException("outerInstance is null");
|
||||||
|
}
|
||||||
mOuterInstanceRef = new WeakReference<T>(outerInstance);
|
mOuterInstanceRef = new WeakReference<T>(outerInstance);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue