嗨,我收到此错误.我正在使用这个
代码http://www.androidhive.info/2012/08/android-working-with-google-places-and-maps-tutorial/
当我点击在地图上显示地点时,我得到了这个错误.请给我解决方案
08-28 16:38:20.554: E/System(4978): Uncaught exception thrown by finalizer08-28 16:38:20.554: E/System(4978): java.lang.IllegalStateException: Binder has been finalized!08-28 16:38:20.554: E/System(4978): at androID.os.BinderProxy.transact(Native Method)08-28 16:38:20.554: E/System(4978): at androID.database.BulkCursorProxy.close(BulkCursorNative.java:288)08-28 16:38:20.554: E/System(4978): at androID.database.BulkCursorToCursorAdaptor.close(BulkCursorToCursorAdaptor.java:133)08-28 16:38:20.554: E/System(4978): at androID.database.CursorWrapper.close(CursorWrapper.java:49)08-28 16:38:20.554: E/System(4978): at androID.content.ContentResolver$CursorWrapperInner.close(ContentResolver.java:1591)08-28 16:38:20.554: E/System(4978): at androID.content.ContentResolver$CursorWrapperInner.finalize(ContentResolver.java:1604)08-28 16:38:20.554: E/System(4978): at java.lang.Daemons$FinalizerDaemon.doFinalize(Daemons.java:182)08-28 16:38:20.554: E/System(4978): at java.lang.Daemons$FinalizerDaemon.run(Daemons.java:168)08-28 16:38:20.554: E/System(4978): at java.lang.Thread.run(Thread.java:856)
这是我的clickevent ..我从上面的androID hive示例引用了相同的代码..这是我需要的代码
Can anyone guide me how to get Google Directions between two locations using JSON
onclick事件
btnShowOnMap = (button) findVIEwByID(R.ID.btn_show_map); // calling background Async task to load Google Places // After getting places from Google all the data is shown in ListvIEw new Loadplaces().execute(); /** button click event for shown on map */ btnShowOnMap.setonClickListener(new VIEw.OnClickListener() { @OverrIDe public voID onClick(VIEw arg0) { Intent i = new Intent(getApplicationContext(), PlacesMapActivity.class); // Sending user current geo location Log.i("getLatitude",""+ gps.getLatitude()); i.putExtra("user_latitude", Double.toString(gps.getLatitude())); i.putExtra("user_longitude", Double.toString(gps.getLongitude())); // passing near places to map activity i.putExtra("near_places", nearPlaces); // staring activity startActivity(i); } });
解决方法:
这是用于在两个位置之间获取Google路线的代码.希望这对您有帮助.
double srcLatitude = 0;double srcLongitude = 0;Location location = GeolocationUtil.getGeolocation(this);if (GeolocationUtil.isValIDLocation(location)) { srcLatitude = location.getLatitude(); srcLongitude = location.getLongitude();}final Intent intent = new Intent(Intent.ACTION_VIEW,/** Using the web based turn by turn directions url. */Uri.parse("http://maps.Google.com/maps?" + "saddr=" + srcLatitude + "," + srcLongitude + "&daddr=" + destLat + "," + destLong));intent.setClassname("com.Google.androID.apps.maps", "com.Google.androID.maps.MapsActivity");startActivity(intent);
总结 以上是内存溢出为你收集整理的终结器抛出未捕获的异常全部内容,希望文章能够帮你解决终结器抛出未捕获的异常所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)