My class should extend two classes at the same time:
public class Preferences extends AbstractBillingActivity {
public class Preferences extends PreferenceActivity {
How to do so?
Upd. Since this is not possible, how should I use that AbstractBillingActivity with Preferences then?
Upd2. If I go with interfaces, should I create:
-
BillingInterface
public interface BillingInterface extends PreferenceActivity, AbstractBillingActivity { } -
PreferenceActivity
public interface PreferenceActivity { } -
AbstractBillingActivity
public interface AbstractBillingActivity { void onCreate(Bundle savedInstanceState); }
and then
public class Preferences implements BillingInterface {
Java does not support multiple inheritance.
There are a few workarounds I can think of:
The first is aggregation: make a class that takes those two activities as fields.
The second is to use interfaces.
The third is to rethink your design: does it make sense for a
Preferencesclass to be both aPreferenceActivityand anAbstractBillingActivity?