5

여기에 Mapsforge 용 단편에 대한 패치가 있음을 알고 있습니다 : https://code.google.com/p/mapsforge/issues/detail?id=177. 그러나 사용 방법을 정확히 모르겠습니다.단편 부분 지원

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:tools="http://schemas.android.com/tools" 
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> 

나는이 오류 받고 있어요 :

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 #6: Error inflating class org.mapsforge.android.maps.MapView 
03-19 15:51:04.243: E/AndroidRuntime(10395): at android.view.LayoutInflater.createView(LayoutInflater.java:606) 
03-19 15:51:04.243: E/AndroidRuntime(10395): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:680) 
03-19 15:51:04.243: E/AndroidRuntime(10395): at android.view.LayoutInflater.rInflate(LayoutInflater.java:739) 
03-19 15:51:04.243: E/AndroidRuntime(10395): at android.view.LayoutInflater.inflate(LayoutInflater.java:489) 
03-19 15:51:04.243: E/AndroidRuntime(10395): at android.view.LayoutInflater.inflate(LayoutInflater.java:396) 
03-19 15:51:04.243: E/AndroidRuntime(10395): at com.fragments.TOfflineMapViewFragment.onCreateView(TOfflineMapViewFragment.java:76) 

은 무엇을

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(Environment.getExternalStorageDirectory().toString() + 
      "/offlineMap/singapore.map"); 

      return view; 
    } 

} 

이 내 XML 파일입니다

는 지금까지 구현 한 것입니다 이걸로 잘못 됐어? 오버라이드 (override)에서 onCreate (에

AndroidGraphicFactory.createInstance(getActivity().getApplication()); 

를 추가

답변

1

는) 나를

을 위해 일