Search in sources :

Example 1 with AbstractAjaxCallback

use of com.androidquery.callback.AbstractAjaxCallback in project androidquery by androidquery.

the class AjaxAuthActivity method auth_facebook.

public void auth_facebook() {
    FacebookHandle handle = new FacebookHandle(this, APP_ID, PERMISSIONS) {

        @Override
        public boolean expired(AbstractAjaxCallback<?, ?> cb, AjaxStatus status) {
            //custom check if re-authentication is required
            if (status.getCode() == 401) {
                return true;
            }
            return super.expired(cb, status);
        }
    };
    String url = "https://graph.facebook.com/me/feed";
    aq.auth(handle).progress(R.id.progress).ajax(url, JSONObject.class, this, "facebookCb");
}
Also used : FacebookHandle(com.androidquery.auth.FacebookHandle) AbstractAjaxCallback(com.androidquery.callback.AbstractAjaxCallback) AjaxStatus(com.androidquery.callback.AjaxStatus)

Aggregations

FacebookHandle (com.androidquery.auth.FacebookHandle)1 AbstractAjaxCallback (com.androidquery.callback.AbstractAjaxCallback)1 AjaxStatus (com.androidquery.callback.AjaxStatus)1