Code example for AndroidRuntimeException

0
	public ExternalStorageReadOnlyOpenHelper( 
	    String dbFileName) {
	  // this.factory = factory; 
 
	   if (!Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
	       throw new AndroidRuntimeException(
	           "External storage (SD-Card) not mounted"); 
	   }  
	   File appDbDir = new File(
	       Environment.getExternalStorageDirectory(),            
	       ""); 
	   if (!appDbDir.exists()) {
	       appDbDir.mkdirs();
	   } 
	   this.dbFile = new File(appDbDir, dbFileName);
	} 
 
	public boolean databaseFileExists() { 
	   return dbFile.exists();
	} 
Contextual code suggestions in your IDE  Get Codota for Java