当前位置: 首页>>代码示例>>Java>>正文


Java AjaxStatus.getCode方法代码示例

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


在下文中一共展示了AjaxStatus.getCode方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: expired

import com.androidquery.callback.AjaxStatus; //导入方法依赖的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: initYingpingServiceData

import com.androidquery.callback.AjaxStatus; //导入方法依赖的package包/类
public void initYingpingServiceData(String url, JSONObject json,
			AjaxStatus status) {
		// TODO Auto-generated method stub

		if (status.getCode() == AjaxStatus.NETWORK_ERROR) {

			app.MyToast(aq.getContext(),
					getResources().getString(R.string.networknotwork));
			return;
		}
		
		if (json == null || json.equals(""))
			return;
		
		String str = json.toString();
		if(str.contains("review_id")) {
			
			isYingPing = true;
		}
		
		Log.i(TAG, "isYingPing--->" + isYingPing + "   --->" + str);
		
		if(!isYingPing) {
			
			yingpingBt.setEnabled(false);
			yingpingBt.setBackgroundResource(R.drawable.yingping_button_unuse_selector);
			yingpingBt.setTextColor(getResources().getColor(R.color.unuse_color));
//			yingpingBt.setFocusable(false);
		}
		
		getGroupSeries(URLUtils.getGroupSeries(prod_id));
	}
 
开发者ID:joyplus,项目名称:joyplus-tv,代码行数:33,代码来源:ShowXiangqingTv.java

示例3: initIsShoucangData

import com.androidquery.callback.AjaxStatus; //导入方法依赖的package包/类
public void initIsShoucangData(String url, JSONObject json, AjaxStatus status){
	
	xiaiBt.setEnabled(true);
	
	if (status.getCode() == AjaxStatus.NETWORK_ERROR||json == null) {
		app.MyToast(aq.getContext(),
				getResources().getString(R.string.networknotwork));
		return;
	}
	
	if(json == null || json.equals("")) 
		return;
	
	Log.d(TAG, "data = " + json.toString());
	
	String flag = json.toString();
	
	if(!flag.equals("")) {
		
		if(flag.contains("true")) {
			isXiai = true;
			ItemStateUtils.shoucangButtonToFocusState(xiaiBt, getApplicationContext());
		} else {
			
			isXiai = false;
			ItemStateUtils.shoucangButtonToNormalState(xiaiBt, getApplicationContext());
		}
	} else {
		
		isXiai = true;
		ItemStateUtils.shoucangButtonToFocusState(xiaiBt, getApplicationContext());
	}
}
 
开发者ID:joyplus,项目名称:joyplus-tv,代码行数:34,代码来源:ShowXiangqingTv.java

示例4: deleteResult

import com.androidquery.callback.AjaxStatus; //导入方法依赖的package包/类
public void deleteResult(String url, JSONObject json, AjaxStatus status){
		if (status.getCode() == AjaxStatus.NETWORK_ERROR)  {
//			aq.id(R.id.ProgressText).invisible();
			app.MyToast(aq.getContext(),
					getResources().getString(R.string.networknotwork));
			return;
		}
		
		if(json == null || json.equals("")) 
			return;
		
		Log.d(TAG, json.toString());
	}
 
开发者ID:joyplus,项目名称:joyplus-tv,代码行数:14,代码来源:ShowShoucangHistoryActivity.java

示例5: initYingpingServiceData

import com.androidquery.callback.AjaxStatus; //导入方法依赖的package包/类
public void initYingpingServiceData(String url, JSONObject json,
			AjaxStatus status) {
		// TODO Auto-generated method stub

		if (status.getCode() == AjaxStatus.NETWORK_ERROR) {

			app.MyToast(aq.getContext(),
					getResources().getString(R.string.networknotwork));
			return;
		}
		
		if (json == null || json.equals(""))
			return;
		
		String str = json.toString();
		if(str.contains("review_id")) {
			
			isYingPing = true;
		}
		
		Log.i(TAG, "isYingPing--->" + yingpingBt);
		
		if(!isYingPing) {
			
			yingpingBt.setEnabled(false);
			yingpingBt.setBackgroundResource(R.drawable.yingping_button_unuse_selector);
			yingpingBt.setTextColor(getResources().getColor(R.color.unuse_color));
//			yingpingBt.setFocusable(false);
		}
	}
 
开发者ID:joyplus,项目名称:joyplus-tv,代码行数:31,代码来源:ShowXiangqingDongman.java

示例6: deleteResult

import com.androidquery.callback.AjaxStatus; //导入方法依赖的package包/类
public void deleteResult(String url, JSONObject json, AjaxStatus status){
		if (status.getCode() == AjaxStatus.NETWORK_ERROR)  {
//			aq.id(R.id.ProgressText).invisible();
			app.MyToast(aq.getContext(),
					getResources().getString(R.string.networknotwork));
			return;
		}
		if(json == null || json.equals("")) 
			return;
		
			Log.d(TAG, json.toString());
	}
 
开发者ID:joyplus,项目名称:joyplus-tv,代码行数:13,代码来源:HistoryActivity.java

示例7: initIsShoucangData

import com.androidquery.callback.AjaxStatus; //导入方法依赖的package包/类
public void initIsShoucangData(String url, JSONObject json,
		AjaxStatus status) {

	xiaiBt.setEnabled(true);

	if (status.getCode() == AjaxStatus.NETWORK_ERROR || json == null) {
		app.MyToast(aq.getContext(),
				getResources().getString(R.string.networknotwork));
		return;
	}

	if (json == null || json.equals(""))
		return;

	Log.d(TAG, "data = " + json.toString());

	String flag = json.toString();

	if (!flag.equals("")) {

		if (flag.contains("true")) {
			isXiai = true;
			ItemStateUtils.shoucangButtonToFocusState(xiaiBt,
					getApplicationContext());
		} else {

			isXiai = false;
			ItemStateUtils.shoucangButtonToNormalState(xiaiBt,
					getApplicationContext());
		}
	} else {

		isXiai = true;
		ItemStateUtils.shoucangButtonToFocusState(xiaiBt,
				getApplicationContext());
	}
}
 
开发者ID:joyplus,项目名称:joyplus-tv,代码行数:38,代码来源:ShowXiangqingMovie.java

示例8: initYingpingServiceData

import com.androidquery.callback.AjaxStatus; //导入方法依赖的package包/类
public void initYingpingServiceData(String url, JSONObject json,
		AjaxStatus status) {
	// TODO Auto-generated method stub

	if (status.getCode() == AjaxStatus.NETWORK_ERROR) {

		app.MyToast(aq.getContext(),
				getResources().getString(R.string.networknotwork));
		return;
	}

	if (json == null || json.equals(""))
		return;

	String str = json.toString();
	if (str.contains("review_id")) {

		isYingPing = true;
	}

	Log.i(TAG, "isYingPing--->" + isYingPing + "   --->" + str);

	if (!isYingPing) {

		yingpingBt.setEnabled(false);
		yingpingBt
				.setBackgroundResource(R.drawable.yingping_button_unuse_selector);
		yingpingBt.setTextColor(getResources()
				.getColor(R.color.unuse_color));
		// yingpingBt.setFocusable(false);
	}
}
 
开发者ID:joyplus,项目名称:joyplus-tv,代码行数:33,代码来源:ShowXiangqingMovie.java

示例9: initIsShoucangData

import com.androidquery.callback.AjaxStatus; //导入方法依赖的package包/类
public void initIsShoucangData(String url, JSONObject json,
		AjaxStatus status) {

	if (status.getCode() == AjaxStatus.NETWORK_ERROR || json == null) {
		app.MyToast(aq.getContext(),
				getResources().getString(R.string.networknotwork));
		return;
	}

	if (json == null || json.equals(""))
		return;

	Log.d(TAG, "data = " + json.toString());

	String flag = json.toString();

	if (!flag.equals("")) {

		if (flag.contains("true")) {

			isShoucang = true;
		} else {

			isShoucang = false;
		}
	} else {

		isShoucang = true;
	}
}
 
开发者ID:joyplus,项目名称:joyplus-tv,代码行数:31,代码来源:VideoPlayerJPActivity.java

示例10: favorityResult

import com.androidquery.callback.AjaxStatus; //导入方法依赖的package包/类
public void favorityResult(String url, JSONObject json,
		AjaxStatus status) {

	if (json != null) {
		try {
			// woof is "00000",now "20024",by yyc
			if (json.getString("res_code").trim().equalsIgnoreCase("00000")) {
				app.MyToast(this, "收藏成功!");
				
				isShoucang = true;
				mBottomButton.setBackgroundResource(R.drawable.player_btn_unfav);
				
				
			} else {
				
				isShoucang = true;
				mBottomButton.setBackgroundResource(R.drawable.player_btn_unfav);
				app.MyToast(this, "已收藏!");
			}
				
		} catch (JSONException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	} else {
		// ajax error, show error code
		if (status.getCode() == AjaxStatus.NETWORK_ERROR)
			app.MyToast(aq.getContext(),
					getResources().getString(R.string.networknotwork));
	}

}
 
开发者ID:joyplus,项目名称:joyplus-tv,代码行数:33,代码来源:VideoPlayerJPActivity.java

示例11: unfavorityResult

import com.androidquery.callback.AjaxStatus; //导入方法依赖的package包/类
public void unfavorityResult(String url, JSONObject json, AjaxStatus status) {
		if (json != null) {
			try {
				if (json.getString("res_code").trim().equalsIgnoreCase("00000")) {
					app.MyToast(this, "取消收藏成功!");

					mBottomButton
					.setBackgroundResource(R.drawable.player_btn_fav);
					isShoucang = false;
//					setResult(JieMianConstant.SHOUCANG_CANCEL);
				} else {
					
					app.MyToast(this, "取消收藏失败!");
					isShoucang = true;
				}

			} catch (JSONException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}

		} else {

			// ajax error, show error code
			if (status.getCode() == AjaxStatus.NETWORK_ERROR)
				app.MyToast(this,
						getResources().getString(R.string.networknotwork));
		}
	}
 
开发者ID:joyplus,项目名称:joyplus-tv,代码行数:30,代码来源:VideoPlayerJPActivity.java

示例12: getArtwork

import com.androidquery.callback.AjaxStatus; //导入方法依赖的package包/类
public void getArtwork(Track track) {
    final String currentArtist = "" + track.getArtist();

    if (currentArtist.equals(""))
        return;

    if (MediaUtils.getArtworkQuick(context, track, 300, 300) != null)
        return;

    if (activeTasks.size() > 2)
        return;

    if (activeTasks.containsKey(currentArtist))
        return;

    activeTasks.put(currentArtist, this);

    AQuery aq = new AQuery(context);
    String url = String.format("http://ws.audioscrobbler.com/2.0/?method=artist.getinfo&api_key=683548928700d0cdc664691b862a8d21&artist=%s&format=json", Uri.encode(currentArtist));
    AjaxCallback<JSONObject> cb = new AjaxCallback<JSONObject>();
    cb.url(url).type(JSONObject.class).fileCache(true).expire(3600 * 60 * 1000);
    aq.sync(cb);
    JSONObject result = cb.getResult();

    if (result != null) {
        JSONObject jsonObject = null;
        String albumArtImageLink = null;
        try {
            if (!result.has("artist"))
                return;

            jsonObject = result.getJSONObject("artist");
            JSONArray image = jsonObject.getJSONArray("image");
            for (int i=0;i<image.length();i++) {
                jsonObject = image.getJSONObject(i);
                if (jsonObject.getString("size").equals("extralarge")) {
                    albumArtImageLink = Uri.decode(jsonObject.getString("#text"));
                }
            }
            if (!(albumArtImageLink != null && albumArtImageLink.equals(""))) {
                String path = MediaUtils.getArtistPath(track);
                if (path != null) {
                    File file = new File(path);

                    AjaxCallback<File> cbFile = new AjaxCallback<File>();
                    cbFile.url(albumArtImageLink).type(File.class).targetFile(file);
                    aq.sync(cbFile);

                    AjaxStatus status = cbFile.getStatus();
                    if (status.getCode() == 200) {
                        if (listener != null)
                            listener.onNewArtwork();
                    } else {
                        file.delete();
                    }
                }
            }
        }
        catch (Exception e) {
            e.printStackTrace();
        }
    }
    activeTasks.remove(currentArtist);
}
 
开发者ID:dmllr,项目名称:IdealMedia,代码行数:65,代码来源:TaskGetArtwork.java

示例13: expired

import com.androidquery.callback.AjaxStatus; //导入方法依赖的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

示例14: expired

import com.androidquery.callback.AjaxStatus; //导入方法依赖的package包/类
@Override
public boolean expired(AbstractAjaxCallback<?, ?> cb, AjaxStatus status) {
	int code = status.getCode();
	return code == 401 || code == 403;
}
 
开发者ID:bblue000,项目名称:ExoPlayerDemo,代码行数:6,代码来源:GoogleHandle.java


注:本文中的com.androidquery.callback.AjaxStatus.getCode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。