I have the following activity
public class ActivityMatchesList extends FragmentActivity implements
LoaderManager.LoaderCallbacks<Cursor> {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ListView lvLive = (ListView)findViewById(R.id.matchListList);
lvLive.setOnItemClickListener(OnItemClickListenerLive);
getSupportLoaderManager().initLoader(1, null, this);
getSupportLoaderManager().initLoader(2, null, this);
getSupportLoaderManager().initLoader(3, null, this);
}
private OnItemClickListener OnItemClickListenerLive = new
OnItemClickListener(){
Intent i = new Intent(ActivityMatchesList.this,
ActivityEvents.class);
finish();
startActivity(i);
}
@Override
public Loader<Cursor> onCreateLoader(int id, Bundle args) { //
FIXME: add switch for 3 loader
switch (id){
case 1:
CursorLoader cursorLoaderLive = new CursorLoader(this,
uri1,null,null,null,null);
return cursorLoaderLive;
case 2:
CursorLoader cursorLoaderRankingLeague = new
CursorLoader(this, uri1,null,null,null,null);
return cursorLoaderRankingLeague;
case 3:
CursorLoader cursorLoaderRankingLive = new
CursorLoader(this, uri1,null,null,null,null);
return cursorLoaderRankingLive;
default:
return null;
}
}
@Override
public void onLoadFinished(Loader<Cursor> loader, Cursor cursor) {
switch (loader.getId()){
case 1:
Adapter1.swapCursor(cursor);
break;
case 2:
Adapter2.swapCursor(cursor);
break;
case 3:
Adapter3.swapCursor(cursor);
break;
}
}
@Override
public void onLoaderReset(Loader<Cursor> loader) {
switch (loader.getId()){
case 1:
Adapter1.swapCursor(null);
break;
case 2:
Adapter2.swapCursor(null);
break;
case 3:
Adapter3.swapCursor(null);
break;
}
}
}
With OnItemClickListener I finish() this activity and start a new,
when I finish the new to return to this sometimes I have the following
error
11-30 09:35:01.839: INFO/dalvikvm(321): Uncaught exception thrown by
finalizer (will be discarded):
11-30 09:35:01.848: INFO/dalvikvm(321): Ljava/lang/
IllegalStateException;: Finalizing cursor
android.database.sqlite.SQLiteCursor@43c6ab00 on MAIN_TABLE that has
not been deactivated or closed
11-30 09:35:01.848: INFO/dalvikvm(321): at
android.database.sqlite.SQLiteCursor.finalize(SQLiteCursor.java:596)
11-30 09:35:01.848: INFO/dalvikvm(321): at
dalvik.system.NativeStart.run(Native Method)
I am not able to discover the reason, someone can help me?
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en