Code example for FileWriter

Methods: close, flush, write

0
		//If there's nothing in the file create a new list 
		if (barcodes == null)
			barcodes = new ArrayList<Barcode>();
 
		barcodes.add(new Barcode(s));
		FileWriter writer = new FileWriter(file);
		writer.write(MySon.toJson(barcodes, barcodeListType));
		writer.flush();
		writer.close();
	} 
 
	private void showInstructions() { 
		AlertDialog.Builder alert = new AlertDialog.Builder(getSherlockActivity());
		alert.setTitle("Instructions");
		alert.setMessage("Scan as many barcodes as your heart desires. "
				+ "These barcodes will be saved to a file which can be analyzed by different program on your" 
				+ " computer to determine what the site is missing."); 
		alert.setPositiveButton("Close", null);
		alert.setCancelable(true);
		alert.create().show();