我有这个java代码:
tgia = new ThumbsGalleryAdapter(this, profilePositionsOverlay.items);
我得到这个错误:
构造函数 ThumbsGalleryAdapter(SharePositionMapActivity, List) 未定义 SharePositionMapActivity.java /com.shopzeus.android.majorforms.activity.MainActivity/src/com/shopzeus/android/majorforms/activity line 114 Java 问题
的构造函数ThumbsGalleryAdapter
是:
public ThumbsGalleryAdapter(Activity aActivity, List<ThumbsGalleryItem> aItems)
类型profilePositionsOverlay.items
:
List<SharedPositionMapItem>
该名称ThumbsGalleryItem
指的是一个接口:
public interface ThumbsGalleryItem {
public String getTitle();
public String getRemotePath();
}
最后,SharedPositionMapItem 是一个实现 ThumbsGalleryItem 的类:
private static class SharedPositionMapItem extends OverlayItem implements ThumbsGalleryItem
当然,问题是:为什么List<SharedPositionMapItem>
类型不兼容List<ThumbsGalleryItem>
?因为SharedPositionMapItem implements ThumbsGalleryItem
,我希望它们是兼容的。解决办法是什么?