本文整理汇总了Java中com.androidquery.callback.AjaxStatus类的典型用法代码示例。如果您正苦于以下问题:Java AjaxStatus类的具体用法?Java AjaxStatus怎么用?Java AjaxStatus使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AjaxStatus类属于com.androidquery.callback包,在下文中一共展示了AjaxStatus类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import com.androidquery.callback.AjaxStatus; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.dialog_find_id_input);
okBtn = (Button)findViewById(R.id.okBtn);
inputCode = (EditText)findViewById(R.id.input_code);
aQuery = new AQuery(getApplicationContext());
params = new HashMap<>();
okBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
aQuery.ajax("http://52.79.134.200/signin", params, String.class, new AjaxCallback<String>(){
@Override
public void callback(String url, String object, AjaxStatus status) {
}
});
}
});
}
示例2: login
import com.androidquery.callback.AjaxStatus; //导入依赖的package包/类
public void login() {
aQuery.ajax(passwd, null, JSONObject.class, new AjaxCallback<JSONObject>() {
@Override
public void callback(String url, JSONObject json, AjaxStatus status) {
String pass = null;
if (json != null) {
try {
pass = json.getString("password");
} catch (JSONException e) {
e.printStackTrace();
}
}
if (status.getCode() == 200 && status.getCode() < 300) {
if (pass.contentEquals(password)) {
facultySubjectMapping = new FacultySubjectMapping(empid, context, sharedPreferences, toast);
facultySubjectMapping.run();
}
}
}
});
}
示例3: 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;
}
示例4: onAjaxDataResponse
import com.androidquery.callback.AjaxStatus; //导入依赖的package包/类
@Override
public boolean onAjaxDataResponse(String url, String result, AjaxStatus status)
{
if (url.endsWith(ApiConfig.USER_LOGIN))
{
if (ReturnInfo.isSuccess(GsonTools.getReturnInfo(result)))
{
setResult(ConstValues.RESULT_LOGIN_SUCCESS);
finish();
}
else
{
setResult(ConstValues.RESULT_LOGIN_ERROR);
}
}
return true;
}
示例5: onAjaxDataResponse
import com.androidquery.callback.AjaxStatus; //导入依赖的package包/类
@Override
public boolean onAjaxDataResponse(String url, String result, AjaxStatus status)
{
if (url.endsWith(ApiConfig.GET_USER_INFO))
{
ReturnInfo returnInfo = GsonTools.getReturnInfo(result);
if (!ReturnInfo.isSuccess(returnInfo))
{
ToastView.showCenterToast(mContext, "登录信息已过期,请重新登录!");
tvName.setText("请登录!");
setbLogin(false);
}
else
{
setbLogin(true);
}
}
return true;
}
示例6: callback
import com.androidquery.callback.AjaxStatus; //导入依赖的package包/类
protected static void callback(String url, VIPVideoToken myToken,
File target, AjaxStatus status,
VideoCache.CacheCallback myCallback) {
synchronized (queueMap) {
WeakHashMap<VIPVideoToken, VideoCache.CacheCallback> ivs = queueMap.remove(url);
videoMap.remove(myToken);
//check if view queue already contains first view
if (null == ivs || !ivs.containsKey(myToken)) {
checkCb(url, myToken, target, status, myCallback);
}
if (null != ivs) {
Set<VIPVideoToken> set = ivs.keySet();
for (VIPVideoToken token : set) {
VideoCache.CacheCallback cb = ivs.get(token);
checkCb(url, token, target, status, cb);
}
}
}
}
示例7: loadImages
import com.androidquery.callback.AjaxStatus; //导入依赖的package包/类
/**
* Using AQuery(a helper class) to load status images and store them on
* sdcard
*/
private void loadImages() {
if (imageUrlList != null && imageUrlList.size() > 0) {
for (Map.Entry<String, String> mapEntry : imageUrlList.entrySet()) {
AQuery aquery = new AQuery(getBaseContext());
final String idValue = mapEntry.getValue();
aquery.ajax(mapEntry.getKey(), Bitmap.class,
new AjaxCallback<Bitmap>() {
@Override
public void callback(String url, Bitmap object,
AjaxStatus status) {
super.callback(url, object, status);
Log.i("store images", url);
storeImages(url, object, idValue);
}
});
}
}
}
示例8: cancelshoucangResult
import com.androidquery.callback.AjaxStatus; //导入依赖的package包/类
public void cancelshoucangResult(String url, JSONObject json, AjaxStatus status){
//闹钟开启的情况下,取消收藏删除数据库中相关数据
if(UtilTools.is48TimeClock(getApplicationContext()))
DBUtils.deleteData4ProId(getApplicationContext(),
UtilTools.getCurrentUserId(getApplicationContext()), prod_id);
xiaiBt.setEnabled(true);
if(favNum - 1 >=0) {
favNum --;
xiaiBt.setText((favNum) + "");
ItemStateUtils.shoucangButtonToNormalState(xiaiBt, getApplicationContext());
}
isXiai = false;
if(json == null || json.equals(""))
return;
Log.d(TAG, "cancel:----->"+json.toString());
}
示例9: shoucangResult
import com.androidquery.callback.AjaxStatus; //导入依赖的package包/类
public void shoucangResult(String url, JSONObject json, AjaxStatus status){
xiaiBt.setEnabled(true);
favNum ++;
xiaiBt.setText(favNum + "");
ItemStateUtils.shoucangButtonToFocusState(xiaiBt, getApplicationContext());
isXiai = true;
if(json == null || json.equals(""))
return;
Log.d(TAG, "shoucangResult:----->" + json.toString());
HotItemInfo info = new HotItemInfo();
info.prod_id = prod_id;
info.prod_name = date.tv.name;
info.score = date.tv.score;
info.prod_pic_url = pic_url;
info.cur_episode = date.tv.cur_episode;
info.max_episode = date.tv.max_episode;
info.prod_type = BangDanConstant.TV_TYPE;
DBUtils.insertOneHotItemInfo2DB(getApplicationContext(),
UtilTools.getCurrentUserId(getApplicationContext()), prod_id, info);
}
示例10: shoucangResult
import com.androidquery.callback.AjaxStatus; //导入依赖的package包/类
public void shoucangResult(String url, JSONObject json, AjaxStatus status){
xiaiBt.setEnabled(true);
favNum ++;
xiaiBt.setText(favNum + "");
ItemStateUtils.shoucangButtonToFocusState(xiaiBt, getApplicationContext());
isXiai = true;
if(json == null || json.equals(""))
return;
Log.d(TAG, "shoucangResult:----->" + json.toString());
HotItemInfo info = new HotItemInfo();
info.prod_id = prod_id;
info.prod_name = date.show.name;
info.score = date.show.score;
info.prod_pic_url = pic_url;
info.cur_episode = date.show.cur_episode;
info.max_episode = date.show.max_episode;
info.prod_type = BangDanConstant.ZONGYI_TYPE;
DBUtils.insertOneHotItemInfo2DB(getApplicationContext(),
UtilTools.getCurrentUserId(getApplicationContext()), prod_id, info);
}
示例11: cancelshoucangResult
import com.androidquery.callback.AjaxStatus; //导入依赖的package包/类
public void cancelshoucangResult(String url, JSONObject json, AjaxStatus status){
xiaiBt.setEnabled(true);
//闹钟开启的情况下,取消收藏删除数据库中相关数据
if(UtilTools.is48TimeClock(getApplicationContext()))
DBUtils.deleteData4ProId(getApplicationContext(),
UtilTools.getCurrentUserId(getApplicationContext()), prod_id);
if(favNum - 1 >=0) {
favNum --;
xiaiBt.setText((favNum) + "");
ItemStateUtils.shoucangButtonToNormalState(xiaiBt, getApplicationContext());
}
isXiai = false;
if(json == null || json.equals(""))
return;
Log.d(TAG, "cancel:----->"+json.toString());
}
示例12: shoucangResult
import com.androidquery.callback.AjaxStatus; //导入依赖的package包/类
public void shoucangResult(String url, JSONObject json, AjaxStatus status){
xiaiBt.setEnabled(true);
favNum ++;
xiaiBt.setText(favNum + "");
ItemStateUtils.shoucangButtonToFocusState(xiaiBt, getApplicationContext());
isXiai = true;
if(json == null || json.equals(""))
return;
Log.d(TAG, "shoucangResult:----->" + json.toString());
HotItemInfo info = new HotItemInfo();
info.prod_id = prod_id;
info.prod_name = date.tv.name;
info.score = date.tv.score;
info.prod_pic_url = pic_url;
info.cur_episode = date.tv.cur_episode;
info.max_episode = date.tv.max_episode;
info.prod_type = BangDanConstant.DONGMAN_TYPE;
DBUtils.insertOneHotItemInfo2DB(getApplicationContext(),
UtilTools.getCurrentUserId(getApplicationContext()), prod_id, info);
}
示例13: cancelshoucangResult
import com.androidquery.callback.AjaxStatus; //导入依赖的package包/类
public void cancelshoucangResult(String url, JSONObject json,
AjaxStatus status) {
xiaiBt.setEnabled(true);
if (favNum - 1 >= 0) {
favNum--;
xiaiBt.setText((favNum) + "");
ItemStateUtils.shoucangButtonToNormalState(xiaiBt,
getApplicationContext());
}
isXiai = false;
if (json == null || json.equals(""))
return;
Log.d(TAG, "cancel:----->" + json.toString());
}
示例14: onCreate
import com.androidquery.callback.AjaxStatus; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.address_book_listview);
final ActionBar chatting = getActionBar();
chatting.setCustomView(R.layout.custom_address_book);
chatting.setDisplayShowTitleEnabled(false);
chatting.setDisplayShowCustomEnabled(true);
chatting.setDisplayShowHomeEnabled(false);
backBtn = (Button) findViewById(R.id.backBtn);
AQuery aq = new AQuery(getApplicationContext());
aq.ajax("http://52.79.134.200/friend", String.class, new AjaxCallback<String>() {
@Override
public void callback(String url, String response, AjaxStatus status) {
if(status.getCode() == 200) {
try {
JSONObject res = new JSONObject(response);
} catch(JSONException e) {
e.printStackTrace();
}
} else {
}
}
}.method(AQuery.METHOD_GET).cookie("UserSession", SessionManager.getCookieFromDB(getApplicationContext())));
backBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(getApplicationContext(), Main.class));
}
});
}
示例15: getInfo
import com.androidquery.callback.AjaxStatus; //导入依赖的package包/类
public void getInfo() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("emp_id", empid);
aQuery.ajax(getInfo, params, JSONObject.class,new AjaxCallback<JSONObject>() {
@Override
public void callback(String url, JSONObject json, AjaxStatus status) {
if (json != null) {
try {
int length = json.getInt("length");
String in = json.getString("ResultSet");
JSONObject reader = new JSONObject(in);
for (int i = 0; i < length; i++) {
JSONObject obj = reader.getJSONObject(String.valueOf(i));
ID = obj.getString("ID");
}
}catch (Exception e){
e.printStackTrace();
}
}else {
Log.d("id", "NULL");
}
if(status.getCode() == 200 && status.getCode() < 300){
if(ID.equals("")) {
//insertInfo();
sendOTP();
} else {
toast = Toast.makeText(context, "Account is registered on another device", Toast.LENGTH_SHORT);
toast.show();
}
}
}
});
}