is SD Card Mounted - Android Hardware

Android examples for Hardware:SD Card

Description

is SD Card Mounted

Demo Code


//package com.java2s;

import android.os.Environment;

public class Main {

    public static boolean isSDCardMounted() {
        boolean result = false;
        try {/*from   w w  w .ja  v  a2  s  .c  o m*/
            result = Environment.getExternalStorageState().equals(
                    Environment.MEDIA_MOUNTED);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return result;
    }
}

Related Tutorials