0

I am developing an application which contain 2 Tab with Fragment.each Tab class AssetsMapFragment and AssetsListFragment Extends with SherlockFragment class, now i need to extends MapActivity in this both Tab Class but according to Java Multiple Inheritance are not supported. and there are another solution with Interface,that i can make interface and implement with it.but my MapActivity is not interface so i cant able to do that. so can you please give some alternate solution for this situation that what i do to use both class in one class ?thats great help for me.thanks.

user123
  • 128
  • 1
  • 9

1 Answers1

0

If possible try like this

public class a {
public static String a="This is a";
public static void aDisplay()
{
    System.out.println(a);
}
}
public class b {
public static String b="This is b";
public static void bDisplay()
{
    System.out.println(b);
}
}
public class c extends a {
public static class d extends b{
    public static void main(String args[]){
    aDisplay();
    bDisplay();
    }
}
}

Using Inner Class concept we can solve the problem. Or in the other way you have to follow Multilevel Inheritance only.

eshwar
  • 1,763
  • 1
  • 18
  • 26
  • but how can i get instance of MapActivity here is the problem – user123 Nov 30 '12 at 10:26
  • class e extends c{ public static class f extends MapActivity{ //Your code Here //You can access mapActivity here, without creating instance //This class e contains all the properties of a,b and MapActivity //This is similar to multiple inheritance } } – eshwar Dec 20 '12 at 06:42