Skip to content

Commit dfb5947

Browse files
committedMar 20, 2014
Fixed sample lint warning
1 parent db119dd commit dfb5947

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed
 

‎sample/src/main/java/com/loopj/android/http/sample/ThreadingTimeoutSample.java

+6-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
public class ThreadingTimeoutSample extends SampleParentActivity {
1212

1313
private static final String LOG_TAG = "ThreadingTimeoutSample";
14-
private SparseArray<String> states = new SparseArray<String>();
14+
private SparseArray<String> states = new SparseArray<>();
1515
private int counter = 0;
1616

1717
@Override
@@ -44,7 +44,7 @@ private synchronized void setStatus(int id, String status) {
4444
states.put(id, current == null ? status : current + "," + status);
4545
clearOutputs();
4646
for (int i = 0; i < states.size(); i++) {
47-
debugResponse(LOG_TAG, states.keyAt(i) + ": " + states.get(states.keyAt(i)));
47+
debugResponse(LOG_TAG, String.format("%d (from %d): %s", states.keyAt(i), getCounter(), states.get(states.keyAt(i))));
4848
}
4949
}
5050

@@ -81,6 +81,10 @@ public void onCancel() {
8181
};
8282
}
8383

84+
public int getCounter() {
85+
return counter;
86+
}
87+
8488
@Override
8589
protected void executeSample(AsyncHttpClient client, String URL, Header[] headers, HttpEntity entity, AsyncHttpResponseHandler responseHandler) {
8690
client.get(this, URL, headers, null, responseHandler);

0 commit comments

Comments
 (0)