未捕获的异常被抛出终结(Uncaught exception thrown by finalizer

2019-07-31 05:37发布

您好我是歌厅此错误。 我使用这个代码http://www.androidhive.info/2012/08/android-working-with-google-places-and-maps-tutorial/

当我在地图上显示的地方点击这个错误我收到。 PLZ ASY我的解决方案

08-28 16:38:20.554: E/System(4978): Uncaught exception thrown by finalizer
08-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 ..我refered samecode从上面的Android蜂巢的样本。这里是我的代码UU需要任何人都可以指导我怎么去使用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);
        }
    });

Answer 1:

这是获取代码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);


Answer 2:

正如我在回答中写道: https://stackoverflow.com/a/13161591/1716620

我认为这个问题是由uncorrect缩放级别而导致进行描绘,则尝试进行图纸之前检查你的缩放级别,我解决了这个方式



文章来源: Uncaught exception thrown by finalizer