MapActivity에 MapView를 올려서 구글맵을 띄우고 있습니다.
엊그제까지는 잘 되던녀석이 어제부터는 아래와 같은 로그를 뱉으며 죽어버리는지라..ㅠㅠ
아무리 구글링을 해보아도 답이 나오지 않아 질문드리네요 ㅠㅠ
MapActivity 맞구요, 구글API 맞습니다 ㅠㅠ
AndroidManifest.xml에는
ACCESS_FINE_LOCATION
ACCESS_NETWORK_STATE
INTERNET 다 되어있네요~
소스에서는 this.setContentView(R.layout.tabstastics);
레이아웃 에서는
<com.google.android.maps.MapView
android:id="@+id/map1"
android:clickable="true"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:apiKey="0rjC4OxV81OPMgzn5xGpZq6rzpi3i5v5ybgNQHQ"
android:layout_below="@id/trgframe"
/>
와 같이 코딩하였습니다.
03-12 03:03:21.357: ERROR/AndroidRuntime(7135): FATAL EXCEPTION: main
03-12 03:03:21.357: ERROR/AndroidRuntime(7135): java.lang.RuntimeException: Unable to start activity ComponentInfo{ds.env.mnt/ds.env.mnt.StasticsActivity}: android.view.InflateException: Binary XML file line #103: Error inflating class com.google.android.maps.MapView
03-12 03:03:21.357: ERROR/AndroidRuntime(7135): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
03-12 03:03:21.357: ERROR/AndroidRuntime(7135): at android.app.ActivityThread.startActivityNow(ActivityThread.java:2503)
03-12 03:03:21.357: ERROR/AndroidRuntime(7135): at android.app.LocalActivityManager.moveToState(LocalActivityManager.java:127)
03-12 03:03:21.357: ERROR/AndroidRuntime(7135): at android.app.LocalActivityManager.startActivity(LocalActivityManager.java:339)
03-12 03:03:21.357: ERROR/AndroidRuntime(7135): at android.widget.TabHost$IntentContentStrategy.getContentView(TabHost.java:666)
03-12 03:03:21.357: ERROR/AndroidRuntime(7135): at android.widget.TabHost.setCurrentTab(TabHost.java:338)
03-12 03:03:21.357: ERROR/AndroidRuntime(7135): at android.widget.TabHost$2.onTabSelectionChanged(TabHost.java:131)
03-12 03:03:21.357: ERROR/AndroidRuntime(7135): at android.widget.TabWidget$TabClickListener.onClick(TabWidget.java:453)
03-12 03:03:21.357: ERROR/AndroidRuntime(7135): at android.view.View.performClick(View.java:2438)
03-12 03:03:21.357: ERROR/AndroidRuntime(7135): at android.view.View$PerformClick.run(View.java:8874)
03-12 03:03:21.357: ERROR/AndroidRuntime(7135): at android.os.Handler.handleCallback(Handler.java:587)
03-12 03:03:21.357: ERROR/AndroidRuntime(7135): at android.os.Handler.dispatchMessage(Handler.java:92)
03-12 03:03:21.357: ERROR/AndroidRuntime(7135): at android.os.Looper.loop(Looper.java:123)
03-12 03:03:21.357: ERROR/AndroidRuntime(7135): at android.app.ActivityThread.main(ActivityThread.java:4627)
03-12 03:03:21.357: ERROR/AndroidRuntime(7135): at java.lang.reflect.Method.invokeNative(Native Method)
03-12 03:03:21.357: ERROR/AndroidRuntime(7135): at java.lang.reflect.Method.invoke(Method.java:521)
03-12 03:03:21.357: ERROR/AndroidRuntime(7135): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:887)
03-12 03:03:21.357: ERROR/AndroidRuntime(7135): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:645)
03-12 03:03:21.357: ERROR/AndroidRuntime(7135): at dalvik.system.NativeStart.main(Native Method)
03-12 03:03:21.357: ERROR/AndroidRuntime(7135): Caused by: android.view.InflateException: Binary XML file line #103: Error inflating class com.google.android.maps.MapView
03-12 03:03:21.357: ERROR/AndroidRuntime(7135): at android.view.LayoutInflater.createView(LayoutInflater.java:513)
03-12 03:03:21.357: ERROR/AndroidRuntime(7135): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:565)
03-12 03:03:21.357: ERROR/AndroidRuntime(7135): at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)
03-12 03:03:21.357: ERROR/AndroidRuntime(7135): at android.view.LayoutInflater.rInflate(LayoutInflater.java:621)
03-12 03:03:21.357: ERROR/AndroidRuntime(7135): at android.view.LayoutInflater.inflate(LayoutInflater.java:407)
03-12 03:03:21.357: ERROR/AndroidRuntime(7135): at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
03-12 03:03:21.357: ERROR/AndroidRuntime(7135): at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
03-12 03:03:21.357: ERROR/AndroidRuntime(7135): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:206)
03-12 03:03:21.357: ERROR/AndroidRuntime(7135): at android.app.Activity.setContentView(Activity.java:1647)
03-12 03:03:21.357: ERROR/AndroidRuntime(7135): at ds.env.mnt.StasticsActivity.onCreate(StasticsActivity.java:215)
03-12 03:03:21.357: ERROR/AndroidRuntime(7135): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
03-12 03:03:21.357: ERROR/AndroidRuntime(7135): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
03-12 03:03:21.357: ERROR/AndroidRuntime(7135): ... 18 more
03-12 03:03:21.357: ERROR/AndroidRuntime(7135): Caused by: java.lang.reflect.InvocationTargetException
03-12 03:03:21.357: ERROR/AndroidRuntime(7135): at com.google.android.maps.MapView.<init>(MapView.java:238)
03-12 03:03:21.357: ERROR/AndroidRuntime(7135): at java.lang.reflect.Constructor.constructNative(Native Method)
03-12 03:03:21.357: ERROR/AndroidRuntime(7135): at java.lang.reflect.Constructor.newInstance(Constructor.java:446)
03-12 03:03:21.357: ERROR/AndroidRuntime(7135): at android.view.LayoutInflater.createView(LayoutInflater.java:500)
03-12 03:03:21.357: ERROR/AndroidRuntime(7135): ... 29 more
03-12 03:03:21.357: ERROR/AndroidRuntime(7135): Caused by: java.lang.NullPointerException
03-12 03:03:21.357: ERROR/AndroidRuntime(7135): at com.google.android.maps.MapActivity.setupMapView(MapActivity.java:382)
03-12 03:03:21.357: ERROR/AndroidRuntime(7135): at com.google.android.maps.MapView.<init>(MapView.java:280)
03-12 03:03:21.357: ERROR/AndroidRuntime(7135): at com.google.android.maps.MapView.<init>(MapView.java:255)
03-12 03:03:21.357: ERROR/AndroidRuntime(7135): ... 33 more




자답이네요;;
setContentView 이전에 super.onCreate(...)를 호출해주어야 했는데
이클립스의 Source->Overide/Implement Methods.. 메뉴를 이용해서 onCreate(...)를 오버라이드 할때는
@Override
protected void onCreate(Bundle icicle) {
// TODO Auto-generated method stub
super.onCreate(icicle);
}
와 같이 기본 작성되기에....ㅠㅠ;;;
setContentView 이전에 super.onCreate(...)가 호출되지 않아서 문제가 발생했었네요;;역시..이클립스를 너무 맹신하는것은 금물이네요...
ps. 왜 유독 Google map을 이용할때만 문제가 발생되는지 명쾌한 답변을 기다립니다~ (__*)
어짜피 Activity에 넘어오는 savedinstance도 null이고, 구글맵의 MapActivity도 savedinstance는 null이 들어오던데 말이지요~
뭔가 MapActivity의 onCreate(...)메소드에서 뭔가 할당을 하는것 같은데 step into로 소스코드를 볼수는 없을까나요....?