It works and is very easy to understand.
TextView state = (TextView) findViewById(R.id.sdcardstatus);
if(Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
state.setText("SD card is present");
} else {
state.setText("SD card is not present");
}
Or refer to this tutorial
HAPPY CODING!
source
share