Code example for ConcurrentModificationException

0
	}	 
	 
	BitmapLoaderTask(String filePath, ImageView imageView, int width, int height) {
		 
		if(Looper.getMainLooper().getThread()!=Thread.currentThread()) {
			throw new ConcurrentModificationException("Cannot create BitmapLoaderTask outside of main thread");
		} 
		 
		imageViewRef = new WeakReference<ImageView>(imageView);
		path = filePath;
		resultWidth = width;
		resultHeight = height;		
	} 
	 
	@Override 
	protected Bitmap doInBackground(Void... params) {
		if(isCancelled()) {
			return null; 
		}		 
		try { 
Stop searching for code, let great code find you!  Add Codota to your java IDE