I am trying to extend BitmapDrawable
public class CenterClampedBitmapDrawable extends BitmapDrawable
I want to have a constructor that takes a BitmapDrawable and uses it to set my baseclass properties.
public CenterClampedBitmapDrawable(BitmapDrawable src) {
I can not work out how to do this, if BitmapDrawable had a copy constructor then I think I would be OK but it has not got one.
I am fairly new to java and this has me stumped, it’s trivial in C++
You’d have to do that manually in the subclass constructor:
Perhaps you can use some reflection utility, like apache commons-beanutils (don’t know if this particular one works on android), but if the properties are not too many, the manual approach is better.