File tree Expand file tree Collapse file tree 2 files changed +6
-8
lines changed
sample/src/main/java/com/loopj/android/http/sample Expand file tree Collapse file tree 2 files changed +6
-8
lines changed Original file line number Diff line number Diff line change 1
1
package com .loopj .android .http .sample ;
2
2
3
- import android .os .Bundle ;
4
-
5
3
public class GetSample extends SampleParentActivity {
6
4
7
5
@ Override
@@ -18,9 +16,4 @@ protected boolean isRequestBodyAllowed() {
18
16
protected boolean isRequestHeadersAllowed () {
19
17
return true ;
20
18
}
21
-
22
- @ Override
23
- protected void onCreate (Bundle savedInstanceState ) {
24
- super .onCreate (savedInstanceState );
25
- }
26
19
}
Original file line number Diff line number Diff line change @@ -19,11 +19,11 @@ public abstract class SampleParentActivity extends Activity {
19
19
private AsyncHttpClient asyncHttpClient = new AsyncHttpClient ();
20
20
private EditText urlEditText ;
21
21
private Button executeButton ;
22
+ private static final LinearLayout .LayoutParams lParams = new LinearLayout .LayoutParams (ViewGroup .LayoutParams .MATCH_PARENT , ViewGroup .LayoutParams .WRAP_CONTENT );
22
23
23
24
@ Override
24
25
protected void onCreate (Bundle savedInstanceState ) {
25
26
super .onCreate (savedInstanceState );
26
- final LinearLayout .LayoutParams lParams = new LinearLayout .LayoutParams (ViewGroup .LayoutParams .MATCH_PARENT , ViewGroup .LayoutParams .WRAP_CONTENT );
27
27
final LinearLayout content_wrapper = new LinearLayout (this );
28
28
content_wrapper .setOrientation (LinearLayout .VERTICAL );
29
29
content_wrapper .setLayoutParams (lParams );
@@ -58,6 +58,11 @@ private void setupHeaders() {
58
58
executeButton .setLayoutParams (new LinearLayout .LayoutParams (ViewGroup .LayoutParams .WRAP_CONTENT , ViewGroup .LayoutParams .WRAP_CONTENT ));
59
59
urlLayout .addView (executeButton );
60
60
headers .addView (urlLayout );
61
+ if (isRequestHeadersAllowed ()){
62
+ LinearLayout headersLayout = new LinearLayout (this );
63
+ headersLayout .setOrientation (LinearLayout .VERTICAL );
64
+ headersLayout .setLayoutParams (lParams );
65
+ }
61
66
}
62
67
63
68
protected final void addView (View v ) {
You can’t perform that action at this time.
0 commit comments