.However I'm not exactly sure how to use it. I've been asking around for help to no avail, and got rejected when I submitted it as an issue.
Also, I would prefer to use SherlockFragments as I need to support lower end OS, thus the solution in Issue #177 might not be as applicable in my situation. Would really appreciate it if there's someone out there that can enlighten me on what's going on with my codes, or if there's anyway I can implement SherlockFragment using the provided codes in Issue #177, I've been trying it for days and I can't even implement MapFragment class as there are so many errors when i placed the java file into my Eclipse project, as there were many missing methods for MapView even when I'm using version 0.3.1.
I've already managed to implement SherlockFragments for osmdroid library, and I thought the implementation should be very similar with mapsforge. However it doesn't seem to work when I coded it in the same way.
This is what I've implemented so far:
public class TOfflineMapViewFragment extends SherlockFragment{
MapView myOpenMapView;
//other codes here...
public View onCreateView(LayoutInflater inflator, ViewGroup container, Bundle savedInstanceState) {
view = inflator.inflate(R.layout.offline_map_activity, container, false);
myOpenMapView = (MapView) view.findViewById(R.id.openmapview);
myOpenMapView.setMapFile(new File("/offlineMap/singapore.map"));
return view;
}
}
This is my xml file:
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<org.mapsforge.android.maps.MapView
android:id="@+id/openmapview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"/>
</LinearLayout>
I'm getting this error:
03-19 15:51:04.243: E/AndroidRuntime(10395): FATAL EXCEPTION: main
03-19 15:51:04.243: E/AndroidRuntime(10395): android.view.InflateException: Binary XML file line #11: Error inflating class org.mapsforge.android.maps.MapView