Projects >> Whiteboard >>43e2ffe2789f818e615de8cd3f4b46d7ed309cb0

Chunk
Conflicting content
 */
package team.win;

<<<<<<< HEAD
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Random;
=======
import java.util.Arrays;
>>>>>>> d2406156ecebf7b553acd9c0ab0c412664e3d5d5

import android.app.Activity;
import android.app.AlertDialog;
Solution content
 */
package team.win;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Random;
import java.util.Arrays;

import android.app.Activity;
import android.app.AlertDialog;
File
WhiteBoardActivity.java
Developer's decision
Concatenation
Kind of conflict
Import
Chunk
Conflicting content
		}
	};

<<<<<<< HEAD
	private boolean saveToSdcard() {
		if(!Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
			System.out.println("External storage not available");
			return false;
		}

		String baseDir = Environment.getExternalStorageDirectory().getAbsolutePath(); 
		File createDirs[] = {
			new File(baseDir + "/Android"),
			new File(baseDir + "/Android/data"),
			new File(baseDir + "/Android/data/" + getClass().getPackage().getName()),
			new File(baseDir + "/Android/data/" + getClass().getPackage().getName() + "/files")
		};

		for (File createDir : createDirs) {
			if(!createDir.exists()) {
				if(!createDir.mkdir()) {
					System.out.println("Couldn't mkdir " + createDir.getAbsolutePath());
					return false;
				}
			}
		}

		File file = new File(createDirs[createDirs.length - 1], "save.dat");
		try {
			mDataStore.serializeDataStore(new FileOutputStream(file));
		} catch (FileNotFoundException e) {
			e.printStackTrace();
			return false;
		} catch (IOException e) {
			e.printStackTrace();
			return false;
		}

		return true;
	}
	
	private boolean loadFromSdcard() {
		if(!Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
			System.out.println("External storage not available");
			return false;
		}

		String baseDir = Environment.getExternalStorageDirectory().getAbsolutePath();
		File file = new File(baseDir + "/Android/data/" + getClass().getPackage().getName() + "/files", "save.dat");
		try {
			mDataStore.deserializeDataStore(new FileInputStream(file));
		} catch (FileNotFoundException e) {
			System.out.println("Could not load save file");
			e.printStackTrace();
			return false;
		} catch (IOException e) {
			System.out.println("I/O error loading save file");
			e.printStackTrace();
			return false;
		}

		return true;
=======
	@Override
	public void colorChanged(int color) {
		mWhiteBoardView.setPrimColor(color);
>>>>>>> d2406156ecebf7b553acd9c0ab0c412664e3d5d5
	}
}
Solution content
		}
	};

	private boolean saveToSdcard() {
		if(!Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
			System.out.println("External storage not available");
			return false;
		}

		String baseDir = Environment.getExternalStorageDirectory().getAbsolutePath(); 
		File createDirs[] = {
			new File(baseDir + "/Android"),
			new File(baseDir + "/Android/data"),
			new File(baseDir + "/Android/data/" + getClass().getPackage().getName()),
			new File(baseDir + "/Android/data/" + getClass().getPackage().getName() + "/files")
		};

		for (File createDir : createDirs) {
			if(!createDir.exists()) {
				if(!createDir.mkdir()) {
					System.out.println("Couldn't mkdir " + createDir.getAbsolutePath());
					return false;
				}
			}
		}

		File file = new File(createDirs[createDirs.length - 1], "save.dat");
		try {
			mDataStore.serializeDataStore(new FileOutputStream(file));
		} catch (FileNotFoundException e) {
			e.printStackTrace();
			return false;
		} catch (IOException e) {
			e.printStackTrace();
			return false;
		}

		return true;
	}
	
	private boolean loadFromSdcard() {
		if(!Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
			System.out.println("External storage not available");
			return false;
		}

		String baseDir = Environment.getExternalStorageDirectory().getAbsolutePath();
		File file = new File(baseDir + "/Android/data/" + getClass().getPackage().getName() + "/files", "save.dat");
		try {
			mDataStore.deserializeDataStore(new FileInputStream(file));
		} catch (FileNotFoundException e) {
			System.out.println("Could not load save file");
			e.printStackTrace();
			return false;
		} catch (IOException e) {
			System.out.println("I/O error loading save file");
			e.printStackTrace();
			return false;
		}

		return true;
	}

	@Override
	public void colorChanged(int color) {
		mWhiteBoardView.setPrimColor(color);
	}
}
File
WhiteBoardActivity.java
Developer's decision
Concatenation
Kind of conflict
Annotation
If statement
Method declaration
Method invocation
Method signature
Return statement
Try statement
Variable