It's a bit of hack but you could store the resource IDs of the drawables in your widget. So on your widget have some code like:
private int mMiddleButtonImage;
public void setMiddleButtonImage(int resourceId) {
mMiddleButtonImage = resourceId;
getMiddleButton().setImageResource(resourceId);
}
The getState()
and restoreState()
method could then use the integer resource IDs rather than the drawables themselves.
Dave Webb
2010-01-26 13:24:37