Java tutorial
//package com.java2s; import android.database.Cursor; import java.io.Closeable; import java.io.IOException; public class Main { public static void close(Closeable c) { if (c != null) { try { c.close(); } catch (IOException e) { e.printStackTrace(); } } } /** If the argument is non-null, close the cursor. */ public static void close(Cursor cursor) { if (cursor != null) { cursor.close(); } } }