Skip to content

Commit ffc70df

Browse files
committed
Fixed aq.ajax overwite callback params.
1 parent 28a5055 commit ffc70df

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

src/com/androidquery/AbstractAQuery.java

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public abstract class AbstractAQuery<T extends AbstractAQuery<T>> implements Con
9999
protected Object progress;
100100
protected AccountHandle ah;
101101
private Transformer trans;
102-
private int policy = CACHE_DEFAULT;
102+
private Integer policy;
103103
private HttpHost proxy;
104104

105105
protected T create(View view){
@@ -1842,11 +1842,21 @@ public <K> T ajax(AjaxCallback<K> callback){
18421842

18431843
protected <K> T invoke(AbstractAjaxCallback<?, K> cb){
18441844

1845+
if(ah != null){
1846+
cb.auth(ah);
1847+
}
1848+
1849+
if(progress != null){
1850+
cb.progress(progress);
1851+
}
18451852

1846-
cb.auth(ah);
1847-
cb.progress(progress);
1848-
cb.transformer(trans);
1849-
cb.policy(policy);
1853+
if(trans != null){
1854+
cb.transformer(trans);
1855+
}
1856+
1857+
if(policy != null){
1858+
cb.policy(policy);
1859+
}
18501860

18511861
if(proxy != null){
18521862
cb.proxy(proxy.getHostName(), proxy.getPort());

0 commit comments

Comments
 (0)