|
22 | 22 | import android.util.Log;
|
23 | 23 | import android.view.View;
|
24 | 24 | import android.widget.Button;
|
| 25 | +import android.widget.CheckBox; |
25 | 26 |
|
26 | 27 | import com.loopj.android.http.AsyncHttpClient;
|
27 | 28 | import com.loopj.android.http.FileAsyncHttpResponseHandler;
|
|
37 | 38 | public class DirectorySample extends SampleParentActivity {
|
38 | 39 | private static final String LOG_TAG = "DirectorySample";
|
39 | 40 | private FileAsyncHttpResponseHandler lastResponseHandler = null;
|
| 41 | + private CheckBox cbAppend, cbRename; |
40 | 42 |
|
41 | 43 | @Override
|
42 | 44 | public int getSampleTitle() {
|
@@ -76,12 +78,20 @@ public void onClick(View v) {
|
76 | 78 | }
|
77 | 79 | }
|
78 | 80 | });
|
| 81 | + cbAppend = new CheckBox(this); |
| 82 | + cbAppend.setText("Constructor \"append\" is true?"); |
| 83 | + cbAppend.setChecked(false); |
| 84 | + cbRename = new CheckBox(this); |
| 85 | + cbRename.setText("Constructor \"renameTargetFileIfExists\" is true?"); |
| 86 | + cbRename.setChecked(true); |
79 | 87 | customFieldsLayout.addView(deleteTargetFile);
|
| 88 | + customFieldsLayout.addView(cbAppend); |
| 89 | + customFieldsLayout.addView(cbRename); |
80 | 90 | }
|
81 | 91 |
|
82 | 92 | @Override
|
83 | 93 | public ResponseHandlerInterface getResponseHandler() {
|
84 |
| - lastResponseHandler = new FileAsyncHttpResponseHandler(getCacheDir(), false, true) { |
| 94 | + lastResponseHandler = new FileAsyncHttpResponseHandler(getCacheDir(), cbAppend.isChecked(), cbRename.isChecked()) { |
85 | 95 | @Override
|
86 | 96 | public void onStart() {
|
87 | 97 | clearOutputs();
|
|
0 commit comments