23

I keep getting this error when launch my app on my galaxy Tab 2 (Samsung). The app i'm developing is quite complicated and it is very hard to track down where this error originates from. So I started to strip down piece by piece my app and I ended up with just a mapview application as you can find here

After stripping I ended up with an app that is just a mapview without an overlayItem ! So following the tutorial until Part 1 point 9.

Here's the MapView Activity:

package com.****.googlemapstutorial;

import com.google.android.maps.MapActivity;
import com.google.android.maps.MapView;
import android.os.Bundle;
import android.view.Menu;

public class MainActivity extends MapActivity 
{

@Override
public void onCreate(Bundle savedInstanceState) 
{
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    MapView mapView = (MapView) findViewById(R.id.mapview);
    mapView.setBuiltInZoomControls(true);
}

@Override
public boolean onCreateOptionsMenu(Menu menu) 
{
    getMenuInflater().inflate(R.menu.activity_main, menu);
    return true;
}

@Override
protected boolean isRouteDisplayed() {
    return false;
}
}

I am truly stomped!

anyone any suggestions ?

The error:
10-28 21:09:22.872: E/System(16840): Uncaught exception thrown by finalizer
10-28 21:09:22.872: E/System(16840): java.lang.IllegalStateException: Binder has been finalized!
10-28 21:09:22.872: E/System(16840): at android.os.BinderProxy.transact(Native Method)
10-28 21:09:22.872: E/System(16840): at android.database.BulkCursorProxy.close(BulkCursorNative.java:288)
10-28 21:09:22.872: E/System(16840): at android.database.BulkCursorToCursorAdaptor.close(BulkCursorToCursorAdaptor.java:133)
10-28 21:09:22.872: E/System(16840): at android.database.CursorWrapper.close(CursorWrapper.java:49)
10-28 21:09:22.872: E/System(16840): at android.content.ContentResolver$CursorWrapperInner.close(ContentResolver.java:1591)
10-28 21:09:22.872: E/System(16840): at android.content.ContentResolver$CursorWrapperInner.finalize(ContentResolver.java:1604)
10-28 21:09:22.872: E/System(16840): at java.lang.Daemons$FinalizerDaemon.doFinalize(Daemons.java:182)
10-28 21:09:22.872: E/System(16840): at java.lang.Daemons$FinalizerDaemon.run(Daemons.java:168)
10-28 21:09:22.872: E/System(16840): at java.lang.Thread.run(Thread.java:856)
Chris
  • 5,584
  • 9
  • 40
  • 58
WiZarD
  • 361
  • 2
  • 5
  • 3
    Are you absolutely sure that you didn't forget to close a `Cursor` somewhere in your app? – tolgap Oct 28 '12 at 19:40
  • Seems to be a duplicate of this: http://stackoverflow.com/questions/12158228/uncaught-exception-thrown-by-finalizer – Phil Oct 28 '12 at 19:57
  • The problem seems to be device -or- android version specific: Running this on a Samsung Galaxy SII running android 4.0.4 running the same code only generates a warning: 10-29 14:19:46.251: W/CursorWrapperInner(29221): Cursor finalized without prior close() – WiZarD Oct 29 '12 at 13:20
  • Well, You can get some help from this question:- http://stackoverflow.com/questions/11884344/map-view-in-tab-layout-throwing-java-lang-illegalstateexception-binder-has-be – Aditya Pratap Singh Nov 16 '12 at 06:38
  • Or perhaps you *did* close the Cursor, but then continued to use it? – Edward Falk Jan 14 '13 at 22:46
  • What version of Android are you using? – Neil Townsend Jun 28 '13 at 16:16

4 Answers4

1

The problem is not exactly device or Android version specific. You have Strict Mode enabled on devices displaying the error. Additionally your cursor needs to be closed before you attempt to close the database.

Frederick Nyawaya
  • 2,285
  • 1
  • 15
  • 19
1

It appears that a cursor may still be open, either in this code file, or somewhere else in your application. Perhaps this link "Android list view with simplecursor adapter crashes application" will be of some help.

Community
  • 1
  • 1
MiStr
  • 1,193
  • 10
  • 17
0

uncaught exception comes only when you did not surround that block of code inside try catch according to me line like this "" CursorWrapper.close(CursorWrapper.java:49) "" will tell you the file and line of file that is creating problem so just go to that line of that particular file and just surround it with try catch. i think you are closing your unoccupied (empty) cursor thatswhy this exception is coming. or do one thing ....give me all your .java class name and also the full error that is displaying. i will surely solve :)

Rahul
  • 710
  • 1
  • 8
  • 25
0

Try running your code in background thread. Plus update your sdk manager one more time, the extra times in SDK.

Taryn
  • 242,637
  • 56
  • 362
  • 405
Yogesh Kumar
  • 682
  • 1
  • 10
  • 29