As per asked in here... I am trying to implement OSM MapView in fragments. I've seen people done this in onCreateView
return new MapView(getActivity(), 256);
However I am not sure how to change my implementation of an Activity into Fragments... right now my Activity codes are like this:
MapView myOpenMapView;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mResourceProxy = new DefaultResourceProxyImpl(getApplicationContext());
setContentView(R.layout.offline_map_activity);
myOpenMapView = (MapView) findViewById(R.id.openmapview);
myOpenMapView.getTileProvider().clearTileCache();
//.... code continues
}
But I'm not sure how to convert this part of the code when implemented in Fragments:
setContentView(R.layout.offline_map_activity);
myOpenMapView = (MapView) findViewById(R.id.openmapview);
How do I instantiate the MapView object properly and return it in the onCreateView method?
asked
20 Feb '13, 14:56
lyk
41●4●4●6
accept rate:
0%
hmm, this site is not really about coding with some specific toolkit... However, please link your post here also in stackoverflow to mitigate the bad effects of crossposting.
I already hyperlinked the stackoverflow question under the word "here". Oh, is this forum not about openstreetmap/OSMDroid? If that's the case where can I ask about implementing fragments with OSMDroid?
@lyk: I saw the "here". I mean that it would be good to insert a link into your question at stackoverflow.
A forum or a mailing list (e.g. dev?) are probably better suited - but you may get an answer here, too. Wait a day or two.