Code example for Closeable

Methods: close

0
    private static final String VIDEO_CAMERA_CLASS = "com.android.camera.VideoCamera";
 
    public static void closeSilently(Closeable c) {
        if (c != null) {
            try { 
                c.close();
            } catch (Throwable e) {
                // ignore 
            } 
        } 
    } 
 
    public static void confirmAction(Context context, String title,
            String message, final Runnable action) {
        OnClickListener listener = new OnClickListener() {
            public void onClick(DialogInterface dialog, int which) {
                switch (which) {
                    case DialogInterface.BUTTON_POSITIVE:
                        if (action != null) action.run();
                } 
            }