• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java AbstractAjaxCallback类的典型用法和代码示例

java 3次浏览

本文整理汇总了Java中com.androidquery.callback.AbstractAjaxCallback的典型用法代码示例。如果您正苦于以下问题:Java AbstractAjaxCallback类的具体用法?Java AbstractAjaxCallback怎么用?Java AbstractAjaxCallback使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

AbstractAjaxCallback类属于com.androidquery.callback包,在下文中一共展示了AbstractAjaxCallback类的26个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: expired

点赞 3

import com.androidquery.callback.AbstractAjaxCallback; //导入依赖的package包/类
@Override
public boolean expired(AbstractAjaxCallback<?, ?> cb, AjaxStatus status)
{
	int code = status.getCode();
	if (code == 200)
		return false;
	String error = status.getError();
	if (error != null && error.contains("OAuthException"))
	{
		AQUtility.debug("fb token expired");
		return true;
	}
	String url = cb.getUrl();
	if (code == 400 && (url.endsWith("/likes") || url.endsWith("/comments") || url.endsWith("/checkins")))
	{
		return false;
	}
	if (code == 403 && (url.endsWith("/feed") || url.contains("method=delete")))
	{
		return false;
	}
	return code == 400 || code == 401 || code == 403;
}
 

开发者ID:libit,
项目名称:lr_dialer,
代码行数:24,
代码来源:FacebookHandle.java

示例2: invoke

点赞 2

import com.androidquery.callback.AbstractAjaxCallback; //导入依赖的package包/类
protected <K> T invoke(AbstractAjaxCallback<?, K> cb)
{
	if (ah != null)
	{
		cb.auth(ah);
	}
	if (progress != null)
	{
		cb.progress(progress);
	}
	if (trans != null)
	{
		cb.transformer(trans);
	}
	//if(policy != null){
	cb.policy(policy);
	//}
	if (proxy != null)
	{
		cb.proxy(proxy.getHostName(), proxy.getPort());
	}
	if (act != null)
	{
		cb.async(act);
	}
	else
	{
		cb.async(getContext());
	}
	reset();
	return self();
}
 

开发者ID:libit,
项目名称:lr_dialer,
代码行数:33,
代码来源:AbstractAQuery.java

示例3: auth

点赞 2

import com.androidquery.callback.AbstractAjaxCallback; //导入依赖的package包/类
public synchronized void auth(AbstractAjaxCallback<?, ?> cb)
{
	if (callbacks == null)
	{
		callbacks = new LinkedHashSet<AbstractAjaxCallback<?, ?>>();
		callbacks.add(cb);
		auth();
	}
	else
	{
		callbacks.add(cb);
	}
}
 

开发者ID:libit,
项目名称:lr_dialer,
代码行数:14,
代码来源:AccountHandle.java

示例4: success

点赞 2

import com.androidquery.callback.AbstractAjaxCallback; //导入依赖的package包/类
protected synchronized void success(Context context)
{
	if (callbacks != null)
	{
		for (AbstractAjaxCallback<?, ?> cb : callbacks)
		{
			cb.async(context);
		}
		callbacks = null;
	}
}
 

开发者ID:libit,
项目名称:lr_dialer,
代码行数:12,
代码来源:AccountHandle.java

示例5: failure

点赞 2

import com.androidquery.callback.AbstractAjaxCallback; //导入依赖的package包/类
protected synchronized void failure(Context context, int code, String message)
{
	if (callbacks != null)
	{
		for (AbstractAjaxCallback<?, ?> cb : callbacks)
		{
			cb.failure(code, message);
		}
		callbacks = null;
	}
}
 

开发者ID:libit,
项目名称:lr_dialer,
代码行数:12,
代码来源:AccountHandle.java

示例6: reauth

点赞 2

import com.androidquery.callback.AbstractAjaxCallback; //导入依赖的package包/类
public boolean reauth(AbstractAjaxCallback<?, ?> cb)
{
	am.invalidateAuthToken(acc.type, token);
	try
	{
		token = am.blockingGetAuthToken(acc, type, true);
		AQUtility.debug("re token", token);
	}
	catch (Exception e)
	{
		AQUtility.debug(e);
		token = null;
	}
	return token != null;
}
 

开发者ID:libit,
项目名称:lr_dialer,
代码行数:16,
代码来源:GoogleHandle.java

示例7: reauth

点赞 2

import com.androidquery.callback.AbstractAjaxCallback; //导入依赖的package包/类
@Override
public boolean reauth(final AbstractAjaxCallback<?, ?> cb)
{
	AQUtility.debug("reauth requested");
	token = null;
	AQUtility.post(new Runnable()
	{
		@Override
		public void run()
		{
			auth(cb);
		}
	});
	return false;
}
 

开发者ID:libit,
项目名称:lr_dialer,
代码行数:16,
代码来源:FacebookHandle.java

示例8: applyToken

点赞 2

import com.androidquery.callback.AbstractAjaxCallback; //导入依赖的package包/类
@Override
public void applyToken(AbstractAjaxCallback<?, ?> cb, HttpRequest request)
{
	String cred = username + ":" + password;
	byte[] data = cred.getBytes();
	String auth = "Basic " + new String(AQUtility.encode64(data, 0, data.length));
	Uri uri = Uri.parse(cb.getUrl());
	String host = uri.getHost();
	request.addHeader("Host", host);
	request.addHeader("Authorization", auth);
}
 

开发者ID:libit,
项目名称:lr_dialer,
代码行数:12,
代码来源:BasicHandle.java

示例9: invoke

点赞 2

import com.androidquery.callback.AbstractAjaxCallback; //导入依赖的package包/类
protected <K> T invoke(AbstractAjaxCallback<?, K> cb){
			
	if(ah != null){
		cb.auth(ah);
	}
	
	if(progress != null){
		cb.progress(progress);
	}
	
	if(trans != null){
		cb.transformer(trans);
	}
	
	//if(policy != null){
		cb.policy(policy);
	//}
	
	if(proxy != null){
		cb.proxy(proxy.getHostName(), proxy.getPort());
	}
	
	if(act != null){
		cb.async(act);
	}else{
		cb.async(getContext());
	}
	
	reset();
	
	return self();
}
 

开发者ID:bblue000,
项目名称:ExoPlayerDemo,
代码行数:33,
代码来源:AbstractAQuery.java

示例10: auth

点赞 2

import com.androidquery.callback.AbstractAjaxCallback; //导入依赖的package包/类
public synchronized void auth(AbstractAjaxCallback<?, ?> cb){		
	
	if(callbacks == null){
		callbacks = new LinkedHashSet<AbstractAjaxCallback<?,?>>();
		callbacks.add(cb);
		auth();
	}else{
		callbacks.add(cb);
	}
			
}
 

开发者ID:bblue000,
项目名称:ExoPlayerDemo,
代码行数:12,
代码来源:AccountHandle.java

示例11: reauth

点赞 2

import com.androidquery.callback.AbstractAjaxCallback; //导入依赖的package包/类
public boolean reauth(AbstractAjaxCallback<?, ?> cb){
	
	am.invalidateAuthToken(acc.type, token);
	
	try {
		token = am.blockingGetAuthToken(acc, type, true);
		AQUtility.debug("re token", token);
	} catch (Exception e) {			
		AQUtility.debug(e);
		token = null;
	} 
	
	return token != null;
	
}
 

开发者ID:bblue000,
项目名称:ExoPlayerDemo,
代码行数:16,
代码来源:GoogleHandle.java

示例12: post

点赞 2

import com.androidquery.callback.AbstractAjaxCallback; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public void post(Dialog d) {
	AQuery aQuery = new AQuery(context);

	aQuery.auth(new BasicHandle("demo", "spring"));

	internalOnPreExecute();

	addHeaderToRequest();
	if (d != null) {
		aQuery.progress(d);
	}
	aQuery.ajax(url, params, mRequestClass, callback);
	AbstractAjaxCallback.setGZip(false);
}
 

开发者ID:MoshDev,
项目名称:TwitterFeedReaderSample,
代码行数:16,
代码来源:AbstractRequest.java

示例13: applyToken

点赞 2

import com.androidquery.callback.AbstractAjaxCallback; //导入依赖的package包/类
public void applyToken(AbstractAjaxCallback<?, ?> cb, HttpRequest request)
{
}
 

开发者ID:libit,
项目名称:lr_dialer,
代码行数:4,
代码来源:AccountHandle.java

示例14: expired

点赞 2

import com.androidquery.callback.AbstractAjaxCallback; //导入依赖的package包/类
@Override
public boolean expired(AbstractAjaxCallback<?, ?> cb, AjaxStatus status)
{
	int code = status.getCode();
	return code == 401 || code == 403;
}
 

开发者ID:libit,
项目名称:lr_dialer,
代码行数:7,
代码来源:GoogleHandle.java

示例15: applyToken

点赞 2

import com.androidquery.callback.AbstractAjaxCallback; //导入依赖的package包/类
@Override
public void applyToken(AbstractAjaxCallback<?, ?> cb, HttpRequest request)
{
	//AQUtility.debug("apply token", token);
	request.addHeader("Authorization", "GoogleLogin auth=" + token);
}
 

开发者ID:libit,
项目名称:lr_dialer,
代码行数:7,
代码来源:GoogleHandle.java

示例16: expired

点赞 2

import com.androidquery.callback.AbstractAjaxCallback; //导入依赖的package包/类
@Override
public boolean expired(AbstractAjaxCallback<?, ?> cb, AjaxStatus status)
{
	return false;
}
 

开发者ID:libit,
项目名称:lr_dialer,
代码行数:6,
代码来源:BasicHandle.java

示例17: reauth

点赞 2

import com.androidquery.callback.AbstractAjaxCallback; //导入依赖的package包/类
@Override
public boolean reauth(AbstractAjaxCallback<?, ?> cb)
{
	return false;
}
 

开发者ID:libit,
项目名称:lr_dialer,
代码行数:6,
代码来源:BasicHandle.java

示例18: applyToken

点赞 2

import com.androidquery.callback.AbstractAjaxCallback; //导入依赖的package包/类
public void applyToken(AbstractAjaxCallback<?, ?> cb, HttpRequest request){		
}
 

开发者ID:bblue000,
项目名称:ExoPlayerDemo,
代码行数:3,
代码来源:AccountHandle.java

示例19: expired

点赞 2

import com.androidquery.callback.AbstractAjaxCallback; //导入依赖的package包/类
@Override
public boolean expired(AbstractAjaxCallback<?, ?> cb, AjaxStatus status) {
	int code = status.getCode();
	return code == 401 || code == 403;
}
 

开发者ID:bblue000,
项目名称:ExoPlayerDemo,
代码行数:6,
代码来源:GoogleHandle.java

示例20: success

点赞 1

import com.androidquery.callback.AbstractAjaxCallback; //导入依赖的package包/类
protected synchronized void success(Context context){
	
	if(callbacks != null){
		
		for(AbstractAjaxCallback<?, ?> cb: callbacks){
			cb.async(context);
		}
		
		callbacks = null;
	}
	
}
 

开发者ID:bblue000,
项目名称:ExoPlayerDemo,
代码行数:13,
代码来源:AccountHandle.java

示例21: failure

点赞 1

import com.androidquery.callback.AbstractAjaxCallback; //导入依赖的package包/类
protected synchronized void failure(Context context, int code, String message){		
	
	if(callbacks != null){
		
		for(AbstractAjaxCallback<?, ?> cb: callbacks){
			cb.failure(code, message);
		}
		
		callbacks = null;
	}
	
}
 

开发者ID:bblue000,
项目名称:ExoPlayerDemo,
代码行数:13,
代码来源:AccountHandle.java

示例22: applyToken

点赞 1

import com.androidquery.callback.AbstractAjaxCallback; //导入依赖的package包/类
@Override
public void applyToken(AbstractAjaxCallback<?, ?> cb, HttpRequest request) {
	
	//AQUtility.debug("apply token", token);
	
	request.addHeader("Authorization", "GoogleLogin auth=" + token);
}
 

开发者ID:bblue000,
项目名称:ExoPlayerDemo,
代码行数:8,
代码来源:GoogleHandle.java

示例23: expired

点赞 1

import com.androidquery.callback.AbstractAjaxCallback; //导入依赖的package包/类
public abstract boolean expired(AbstractAjaxCallback<?, ?> cb, AjaxStatus status); 

开发者ID:libit,
项目名称:lr_dialer,
代码行数:2,
代码来源:AccountHandle.java

示例24: reauth

点赞 1

import com.androidquery.callback.AbstractAjaxCallback; //导入依赖的package包/类
public abstract boolean reauth(AbstractAjaxCallback<?, ?> cb); 

开发者ID:libit,
项目名称:lr_dialer,
代码行数:2,
代码来源:AccountHandle.java

示例25: applyProxy

点赞 1

import com.androidquery.callback.AbstractAjaxCallback; //导入依赖的package包/类
public abstract void applyProxy(AbstractAjaxCallback<?, ?> cb, HttpRequest request, DefaultHttpClient client); 

开发者ID:bblue000,
项目名称:ExoPlayerDemo,
代码行数:2,
代码来源:ProxyHandle.java

示例26: makeProxy

点赞 1

import com.androidquery.callback.AbstractAjaxCallback; //导入依赖的package包/类
public abstract Proxy makeProxy(AbstractAjaxCallback<?, ?> cb); 

开发者ID:bblue000,
项目名称:ExoPlayerDemo,
代码行数:2,
代码来源:ProxyHandle.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)