startManagedCursor()が/対db.close()および/またはcursor.close()にどのように作用するのか疑問に思っていますドキュメントを読みましたが、まだあいまいです%-)...そして、startManagedCursor()が非推奨のAPIであることを理解しました> = 11. <android2.3.xで使用する必要があると思います。
コードコメントには2つの質問があります。ありがとう !
SOR!... SO Rocks :)
Cursor c = null;
try {
dbHelper.open() ;
c = dbHelper.getMyRecords() ;
startManagingCursor(c) ;
if ( c.moveToFirst() ) { uberCool (stuff, here) ; }
dbHelper.close() ;// <** Question 1 : Is cursor also closed here ?
} catch (Exception e) {
Log.d ("OOPS", Caught exception: " + e.toString() ) ;
} finally {
// ** Question 2 : Is the close() just below redundant
// - will the managed cursor just close when function
// goes out of scope ?
if (c != null) c.close() ;
}