37
37
38
38
import org .apache .http .Header ;
39
39
import org .apache .http .HttpEntity ;
40
+ import org .apache .http .client .methods .HttpUriRequest ;
40
41
import org .apache .http .entity .StringEntity ;
42
+ import org .apache .http .impl .client .DefaultHttpClient ;
41
43
import org .apache .http .message .BasicHeader ;
44
+ import org .apache .http .protocol .HttpContext ;
42
45
43
46
import java .io .PrintWriter ;
44
47
import java .io .StringWriter ;
47
50
import java .util .LinkedList ;
48
51
import java .util .List ;
49
52
import java .util .Locale ;
50
- import org .apache .http .client .methods .HttpUriRequest ;
51
- import org .apache .http .impl .client .DefaultHttpClient ;
52
- import org .apache .http .protocol .HttpContext ;
53
53
54
54
public abstract class SampleParentActivity extends Activity implements SampleInterface {
55
55
56
56
private AsyncHttpClient asyncHttpClient = new AsyncHttpClient () {
57
57
58
- @ Override
59
- protected AsyncHttpRequest newAsyncHttpRequest (DefaultHttpClient client , HttpContext httpContext , HttpUriRequest uriRequest , String contentType , ResponseHandlerInterface responseHandler , Context context ) {
60
- AsyncHttpRequest httpRequest = getHttpRequest (client , httpContext , uriRequest , contentType , responseHandler , context );
61
- return httpRequest == null
62
- ? super .newAsyncHttpRequest (client , httpContext , uriRequest , contentType , responseHandler , context )
63
- : httpRequest ;
64
- }
58
+ @ Override
59
+ protected AsyncHttpRequest newAsyncHttpRequest (DefaultHttpClient client , HttpContext httpContext , HttpUriRequest uriRequest , String contentType , ResponseHandlerInterface responseHandler , Context context ) {
60
+ AsyncHttpRequest httpRequest = getHttpRequest (client , httpContext , uriRequest , contentType , responseHandler , context );
61
+ return httpRequest == null
62
+ ? super .newAsyncHttpRequest (client , httpContext , uriRequest , contentType , responseHandler , context )
63
+ : httpRequest ;
64
+ }
65
65
};
66
66
private EditText urlEditText , headersEditText , bodyEditText ;
67
67
private LinearLayout responseLayout ;
@@ -193,8 +193,8 @@ public String getUrlText() {
193
193
194
194
public String getUrlText (String defaultText ) {
195
195
return urlEditText != null && urlEditText .getText () != null
196
- ? urlEditText .getText ().toString ()
197
- : defaultText ;
196
+ ? urlEditText .getText ().toString ()
197
+ : defaultText ;
198
198
}
199
199
200
200
public String getBodyText () {
@@ -203,8 +203,8 @@ public String getBodyText() {
203
203
204
204
public String getBodyText (String defaultText ) {
205
205
return bodyEditText != null && bodyEditText .getText () != null
206
- ? bodyEditText .getText ().toString ()
207
- : defaultText ;
206
+ ? bodyEditText .getText ().toString ()
207
+ : defaultText ;
208
208
}
209
209
210
210
public String getHeadersText () {
@@ -213,8 +213,8 @@ public String getHeadersText() {
213
213
214
214
public String getHeadersText (String defaultText ) {
215
215
return headersEditText != null && headersEditText .getText () != null
216
- ? headersEditText .getText ().toString ()
217
- : defaultText ;
216
+ ? headersEditText .getText ().toString ()
217
+ : defaultText ;
218
218
}
219
219
220
220
protected final void debugHeaders (String TAG , Header [] headers ) {
0 commit comments