diff --git a/sample/src/main/java/com/loopj/android/http/sample/UsePoolThreadSample.java b/sample/src/main/java/com/loopj/android/http/sample/UsePoolThreadSample.java index 9c7aaa4db..45dd61fdd 100644 --- a/sample/src/main/java/com/loopj/android/http/sample/UsePoolThreadSample.java +++ b/sample/src/main/java/com/loopj/android/http/sample/UsePoolThreadSample.java @@ -1,13 +1,14 @@ package com.loopj.android.http.sample; import android.util.Log; + import com.loopj.android.http.AsyncHttpResponseHandler; import com.loopj.android.http.ResponseHandlerInterface; -import static com.loopj.android.http.sample.SampleParentActivity.LIGHTGREEN; -import java.io.File; import org.apache.http.Header; +import java.io.File; + public class UsePoolThreadSample extends GetSample { private static final String LOG_TAG = "UsePoolThreadSample"; @@ -95,12 +96,9 @@ public void run() { } private File getRandomCacheFile() { - File dir = getExternalCacheDir(); - if(dir == null) { - dir = getCacheDir(); - if(dir == null) { - dir = getFilesDir(); - } + File dir = getCacheDir(); + if (dir == null) { + dir = getFilesDir(); } return new File(dir, "sample-" + System.currentTimeMillis() + ".bin"); @@ -108,7 +106,7 @@ private File getRandomCacheFile() { private void saveBytesOnDisk(File destination, byte[] bytes) { // TODO: Spin your own implementation to save the bytes on disk/SD card. - if(bytes != null && destination != null) { + if (bytes != null && destination != null) { Log.d(LOG_TAG, "Saved " + bytes.length + " bytes into file: " + destination.getAbsolutePath()); } }