我有一个扩展谷歌 MapView 的视图。和一个带有项目的 ListView。我需要的是把 MyMapView 作为列表视图的标题。请帮忙怎么办
更新:当我尝试这样做时:
LayoutInflater inflater = (LayoutInflater)getApplicationContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
ListView list = (ListView) findViewById(R.id.list);
View m = inflater.inflate(R.layout.map, list, false);
list.addHeaderView(m);
我收到一个错误:
MapViews 只能在 MapActivity 的实例中创建
我认为这是因为我已经从我的活动中删除了我的 xml 布局以将 map 转换为 different.xml