I know that java doesn’t support multiple inheritance. So how can i fulfill following requirement.
This is my current class:
public class Class1 extends ExpandableListActivity implements ExpandableListView.OnChildClickListener, OnTouchListener, OnItemLongClickListener, OnClickListener, Runnable
{
@Override
public void onCreate(Bundle savedInstanceState) {
...
}
}
Now i also want to extends it using “FragmentActivity” class.
Example:
public class Class1 extends ExpandableListActivity, FragmentActivity implements ExpandableListView.OnChildClickListener, OnTouchListener, OnItemLongClickListener, OnClickListener, Runnable
{
@Override
public void onCreate(Bundle savedInstanceState) {
...
}
}
You cannot. You are implementing an activity, so it should be either an ExpandableListActivity or a FragmentActivity, but it cannot be both. Depending on what your actual needs are, you should choose one. But one approach that is possible is to add an ExpandableListView to your FragmentActivity layout.