Code example for AtomicReferenceArray

	private static class DownloadImagesTask extends 
			AsyncTask<String, Integer, Void> {
		private AsyncTaskLabActivity mActivity;
		private AtomicReferenceArray<Bitmap> mDownloadedBitmaps = new AtomicReferenceArray<Bitmap>(
		public DownloadImagesTask(AsyncTaskLabActivity activity) {
			this.mActivity = activity;
		protected Void doInBackground(String... urls) {
			for (int i = 0; i < urls.length; i++) {
				if (!isCancelled()) {
					try { 
						Bitmap bitmap = BitmapFactory
								.decodeStream((InputStream) new URL(urls[i])
						mDownloadedBitmaps.set(i, bitmap);
Connect your IDE to all the code out there  Get Codota for Java