마스터Q&A 안드로이드는 안드로이드 개발자들의 질문과 답변을 위한 지식 커뮤니티 사이트입니다. 안드로이드펍에서 운영하고 있습니다. [사용법, 운영진]

구글맵 inflating 에러 질문이요 ㅠㅠ미치겠습니다

0 추천

메니페스트 작업완벽하구요..

라이브러리도 확실히 추가했어요 ㅠㅠ

지금 메인 페이지에서 버튼을 누르면 

Map이라는 fragmentActivity 로 넘어가야되는데 

계속 에러가뜨네요.

+.02-07 00:40:46.189: E/AndroidRuntime(14955): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.omp.fbi/com.omp.fbi.Map}: android.view.InflateException: Binary XML file line #7: Error inflating class fragment

02-07 00:40:46.189: E/AndroidRuntime(14955): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.omp.fbi/com.omp.fbi.Map}: android.view.InflateException: Binary XML file line #7: Error inflating class fragment

02-07 00:40:46.189: E/AndroidRuntime(14955): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.omp.fbi/com.omp.fbi.Map}: android.view.InflateException: Binary XML file line #7: Error inflating class fragment
 
이렇게 에러가뜨는데 현재 
 
프래그먼트 액티비티에는요
public class Map extends FragmentActivity {
double latitude =37.519576;
double longitude = 123.940245;
private GoogleMap googleMap;
 
protected void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.map);
init();
}
 
 
 
 
protected void onResume(){
super.onResume();
init();
}
 
 
void init(){
if(googleMap==null){
googleMap = ((SupportMapFragment)getSupportFragmentManager().findFragmentById(R.id.fragment5)).getMap();
if(googleMap != null){
addMarker();
}
}
}
 
void addMarker(){
googleMap.addMarker(new MarkerOptions().position(new LatLng(latitude, longitude)).title("simpe marker"));
}
 
}
 
로 되있고
 
레이아웃에는 
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >
    
<fragment 
    
    android:id="@+id/fragment5"
    android:name="com.google.android.gms.maps.SupportMapFragment"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
     />
</LinearLayout>
 
그리고 메인 페이지에서 Map FragmentActivity로 가는 인텐트는요
public void btnContentMenu(View v){
 
intent = new Intent(this, Map.class);
startActivity(intent);
}
입니다
로 되있습니다..도와주세요 제발 ㅠㅠ
 
브붐 (970 포인트) 님이 2014년 2월 7일 질문

1개의 답변

0 추천

 SupportMapFragment 이걸로 상속받아서 해보심이

Gradler (109,780 포인트) 님이 2014년 2월 7일 답변
어디에 상속을 받으라는 말씀이시죠?
FragmentActivity 대신 위에 껄로 상속받아보세요
...