Here is the scope. I am trying to create a base class you will be subclassing and running into some snags. I want to create a method that returns a view so it can be overridden by any of its subclasses such as ListView, GridView, TextView, etc. Not sure if that is even possible or if I am going about it the wrong way, but here is the code below.
This is the base view method in my class:
View backViewController()
{
return null;
}
Here is the subclass:
@Override
View backViewController()
{
MenuList = (ListView) findViewById(R.id.backView);
return MenuList;
}
With MenuList being a ListView I created in the subclass and trying to use in place of the base View. The error I am receiving is “The return type is incompatible”.
Is R.id.backView a ListView in the xml layout ?