http://gmaps-samples.googlecode.com/svn/trunk/articles-android-webmap
我在这下载下来的例子,运行不了。不知怎么回事。 刚开始学习google map api。之前弄通了mapview, 现在我想搞个webview。

解决方案 »

  1.   

    现在的问题是,编译、运行可以。 然后模拟机上提示 The application WebMapActivty(Process com.google.android.examples.webmap)has stopped unexpectedly.Please try again.
    Eclipse console 没有任何提示。 然后,我打开Debug,Cat里面的日子,最后部分,从出错的前面一点开始,如下:
    06-28 16:47:42.459: DEBUG/dalvikvm(385): Debugger has detached; object registry had 1 entries
    06-28 16:47:42.650: INFO/AndroidRuntime(385): NOTE: attach of thread 'Binder Thread #3' failed
    06-28 16:47:43.049: WARN/ActivityManager(66): Activity pause timeout for HistoryRecord{44ea0860 com.android.launcher/com.android.launcher2.Launcher}
    06-28 16:47:44.417: INFO/ActivityManager(66): Start proc com.google.android.examples.webmap for activity com.google.android.examples.webmap/.WebMapActivity: pid=392 uid=10044 gids={3003, 1015}
    06-28 16:47:52.390: DEBUG/SntpClient(66): request time failed: java.net.SocketException: Address family not supported by protocol06-28 16:47:52.491: WARN/ActivityManager(66): Launch timeout has expired, giving up wake lock!
    06-28 16:47:54.064: DEBUG/AndroidRuntime(392): Shutting down VM
    06-28 16:47:54.064: WARN/dalvikvm(392): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
    06-28 16:47:54.989: ERROR/AndroidRuntime(392): FATAL EXCEPTION: main
    06-28 16:47:54.989: ERROR/AndroidRuntime(392): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.google.android.examples.webmap/com.google.android.examples.webmap.WebMapActivity}: java.lang.NullPointerException
    06-28 16:47:54.989: ERROR/AndroidRuntime(392):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
    06-28 16:47:54.989: ERROR/AndroidRuntime(392):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
    06-28 16:47:54.989: ERROR/AndroidRuntime(392):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)
    06-28 16:47:54.989: ERROR/AndroidRuntime(392):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
    06-28 16:47:54.989: ERROR/AndroidRuntime(392):     at android.os.Handler.dispatchMessage(Handler.java:99)
    06-28 16:47:54.989: ERROR/AndroidRuntime(392):     at android.os.Looper.loop(Looper.java:123)
    06-28 16:47:54.989: ERROR/AndroidRuntime(392):     at android.app.ActivityThread.main(ActivityThread.java:4627)
    06-28 16:47:54.989: ERROR/AndroidRuntime(392):     at java.lang.reflect.Method.invokeNative(Native Method)
    06-28 16:47:54.989: ERROR/AndroidRuntime(392):     at java.lang.reflect.Method.invoke(Method.java:521)
    06-28 16:47:54.989: ERROR/AndroidRuntime(392):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
    06-28 16:47:54.989: ERROR/AndroidRuntime(392):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
    06-28 16:47:54.989: ERROR/AndroidRuntime(392):     at dalvik.system.NativeStart.main(Native Method)
    06-28 16:47:54.989: ERROR/AndroidRuntime(392): Caused by: java.lang.NullPointerException
    06-28 16:47:54.989: ERROR/AndroidRuntime(392):     at com.google.android.examples.webmap.WebMapActivity.setupWebView(WebMapActivity.java:33)
    06-28 16:47:54.989: ERROR/AndroidRuntime(392):     at com.google.android.examples.webmap.WebMapActivity.onCreate(WebMapActivity.java:26)
    06-28 16:47:54.989: ERROR/AndroidRuntime(392):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
    06-28 16:47:54.989: ERROR/AndroidRuntime(392):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
    06-28 16:47:54.989: ERROR/AndroidRuntime(392):     ... 11 more
    06-28 16:47:55.370: WARN/ActivityManager(66):   Force finishing activity com.google.android.examples.webmap/.WebMapActivity
    06-28 16:47:56.540: WARN/ActivityManager(66): Activity pause timeout for HistoryRecord{450a8310 com.google.android.examples.webmap/.WebMapActivity}
    06-28 16:47:57.318: WARN/ActivityManager(66): Activity idle timeout for HistoryRecord{450a8310 com.google.android.examples.webmap/.WebMapActivity}
    06-28 16:48:03.793: DEBUG/dalvikvm(315): GC_EXPLICIT freed 322 objects / 15104 bytes in 9022ms
    06-28 16:48:04.385: DEBUG/dalvikvm(156): GC_EXPLICIT freed 2134 objects / 107120 bytes in 32455ms
    06-28 16:48:07.020: DEBUG/dalvikvm(232): GC_EXPLICIT freed 176 objects / 9808 bytes in 1209ms
    06-28 16:48:08.087: WARN/ActivityManager(66): Activity destroy timeout for HistoryRecord{450a8310 com.google.android.examples.webmap/.WebMapActivity}
    06-28 16:50:56.323: INFO/Process(392): Sending signal. PID: 392 SIG: 9
    06-28 16:50:56.912: WARN/InputManagerService(66): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@4509a980
    06-28 16:50:57.198: INFO/ActivityManager(66): Process com.google.android.examples.webmap (pid 392) has died.