I've an interface defined as
public interface QueryCompleteListener {
void onQueryCompleted(int token, ArrayList<Object1> songList);
}
I'm using this interface to return callback. In some callbacks I want to pass ArrayList<Object1> and in some cases I want to pass ArrayList<Object2> through the interface.
If I declare interface method as
void onQueryCompleted(int token, ArrayList<Object> songList)
to pass any type of Object, it gives an error saying found Object1 required Object when I call this method by passing ArrayList<Object1>