문제

I am developing an android application and I need to know how could i check if the sdcard exist or not before exporting a file to it , so that i could notify the user that the sdcard is or isn't mounted.

도움이 되었습니까?

해결책

public boolean hasSDCard() {
    return android.os.Environment.getExternalStorageState()
              .equals(android.os.Environment.MEDIA_MOUNTED);
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top