Code to check is SDCard exists or not in Android Device,Android



if (android.os.Environment.getExternalStorageState().equals(
                                android.os.Environment.MEDIA_MOUNTED)){
                               
                        Intent i =new Intent(AddJobScreen.this,FilesListScreen.class);
                        startActivity(i);
                        }else{
                            SharedVariables.showAlertMessage(SharedVariables.globalContext.getString(R.string.no_sdcard_msg), AddJobScreen.this);                           
                        }


Here i checked is SDCard exists or not,
a)if it was not exists then i showed an alert message..
b) if it exists i called an Activity..

Comments

Popular posts from this blog

Custom Dialog with no title and full screen in Android

Best working code to set Date limits on Date Picker Dialog,in Android

code to display .pdf,.text,.DOC,.DOCX,.doc extension files exists in SDCard