Java tutorial
//package com.java2s; // Use of this source code is governed by a BSD-style license that can be import android.util.Log; import java.io.File; public class Main { private static final String TAG = "LibraryLoaderHelper"; private static void deleteDirectorySync(File dir) { try { File[] files = dir.listFiles(); if (files != null) { for (File file : files) { String fileName = file.getName(); if (!file.delete()) { Log.e(TAG, "Failed to remove " + file.getAbsolutePath()); } } } if (!dir.delete()) { Log.w(TAG, "Failed to remove " + dir.getAbsolutePath()); } return; } catch (Exception e) { Log.e(TAG, "Failed to remove old libs, ", e); } } }