当我调用这个createMarker()方法时,我得到一个IllegalArgumentException:
private voID createMarker(GoogleMap map, MarkerOptions options, OnMarkerCreateListener Listener) { Log.e("LazyMarker", "Options var val: "+options); Log.i("LazyMarker", "GoogleMap Value:"+map); Log.i("LazyMarker", "OnMarkerCreateListener Value:"+Listener); marker = map.addMarker(options); //Log.i("LazyMarker", "The value of Marker is:"+map.addMarker(options)); if (Listener != null) { Listener.onMarkerCreate(this); }}
这是logcat输出:
06-14 11:40:38.627: I/OGT.RIDeTracking(25590): Map value is: com.Google.androID.gms.maps.GoogleMap@4249bd3006-14 11:40:38.627: E/LazyMarker(25590): Options var val: com.Google.androID.gms.maps.model.MarkerOptions@4318baf806-14 11:40:38.627: I/LazyMarker(25590): GoogleMap Value:com.Google.androID.gms.maps.GoogleMap@4249bd3006-14 11:40:38.627: I/LazyMarker(25590): OnMarkerCreateListener Value:null06-14 11:40:38.637: D/AndroIDRuntime(25590): Shutting down VM06-14 11:40:38.637: W/dalvikvm(25590): threadID=1: thread exiting with uncaught exception (group=0x415d7438)06-14 11:40:38.637: E/AndroIDRuntime(25590): FATAL EXCEPTION: main06-14 11:40:38.637: E/AndroIDRuntime(25590): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.androID.gpstracker/com.polaris.epicrIDers.RIDes.RIDeTracking}: java.lang.IllegalArgumentException: no position in marker options06-14 11:40:38.637: E/AndroIDRuntime(25590): at androID.app.ActivityThread.performlaunchActivity(ActivityThread.java:2088)06-14 11:40:38.637: E/AndroIDRuntime(25590): at androID.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2113)06-14 11:40:38.637: E/AndroIDRuntime(25590): at androID.app.ActivityThread.access0(ActivityThread.java:139)06-14 11:40:38.637: E/AndroIDRuntime(25590): at androID.app.ActivityThread$H.handleMessage(ActivityThread.java:1224)06-14 11:40:38.637: E/AndroIDRuntime(25590): at androID.os.Handler.dispatchMessage(Handler.java:99)06-14 11:40:38.637: E/AndroIDRuntime(25590): at androID.os.Looper.loop(Looper.java:137)06-14 11:40:38.637: E/AndroIDRuntime(25590): at androID.app.ActivityThread.main(ActivityThread.java:4918)06-14 11:40:38.637: E/AndroIDRuntime(25590): at java.lang.reflect.Method.invokeNative(Native Method)06-14 11:40:38.637: E/AndroIDRuntime(25590): at java.lang.reflect.Method.invoke(Method.java:511)06-14 11:40:38.637: E/AndroIDRuntime(25590): at com.androID.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1004)06-14 11:40:38.637: E/AndroIDRuntime(25590): at com.androID.internal.os.ZygoteInit.main(ZygoteInit.java:771)06-14 11:40:38.637: E/AndroIDRuntime(25590): at dalvik.system.NativeStart.main(Native Method)06-14 11:40:38.637: E/AndroIDRuntime(25590): Caused by: java.lang.IllegalArgumentException: no position in marker options
我的MarkerOptions和GoogleMap值不为空?问题在于这一行:
marker = map.addMarker(options);
当我评论上面的线路时,应用程序继续下一个活动就好了.这是我的问题?任何帮助,将不胜感激.
解决方法:
Caused by: java.lang.IllegalArgumentException: no position in marker options
显然,您的MarkerOptions没有位置.请拨打position()以提供放置标记的位置.
总结以上是内存溢出为你收集整理的java – Android – Google Maps Extensions – IllegalArgumentException全部内容,希望文章能够帮你解决java – Android – Google Maps Extensions – IllegalArgumentException所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)