Because of a missing check for mSlots[i]!=null
removeWidget throws NPE, if mSlots[i] == null ...
this method should become:
public void removeWidget(Widget widget) {
mFather.removeWidget(widget);
for (int i = 0; i < mSlots.length; i++) {
if (mSlots[i]!=null) {
if (mSlots[i].mWidget == widget) {
mSlots[i] = null;
}
}
}
}