We can check SD card is present or not before doing the file operations on the SD card,
For Example:
public static boolean isSDcardPresent(){
return android.os.Environment.getExternalStorageState().equals(android.os.Environment.MEDIA_MOUNTED);
}
This code will return true if the SD card is present.
For Example:
public static boolean isSDcardPresent(){
return android.os.Environment.getExternalStorageState().equals(android.os.Environment.MEDIA_MOUNTED);
}
This code will return true if the SD card is present.
Comments
Post a Comment