Java Code Examples for com.socks.jiandan.net.RequestManager

The following examples show how to use com.socks.jiandan.net.RequestManager. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: JianDan_OkHttpWithVolley   Source File: PictureAdapter.java    License: Apache License 2.0 6 votes vote down vote up
private void loadData() {

        RequestManager.addRequest(new Request4Picture(Picture.getRequestUrl(mType, page),
                new Response.Listener<ArrayList<Picture>>
                        () {
                    @Override
                    public void onResponse(ArrayList<Picture> response) {
                        getCommentCounts(response);
                    }
                }, new Response.ErrorListener() {
            @Override
            public void onErrorResponse(VolleyError error) {
                mLoadResultCallBack.onError(LoadResultCallBack.ERROR_NET, error.getMessage());
                mLoadFinisCallBack.loadFinish(null);
            }
        }), mActivity);
    }
 
Example 2
Source Project: JianDan   Source File: PictureAdapter.java    License: Apache License 2.0 6 votes vote down vote up
private void loadData() {

        RequestManager.addRequest(new Request4Picture(Picture.getRequestUrl(mType, page),
                new Response.Listener<ArrayList<Picture>>
                        () {
                    @Override
                    public void onResponse(ArrayList<Picture> response) {
                        getCommentCounts(response);
                    }
                }, new Response.ErrorListener() {
            @Override
            public void onErrorResponse(VolleyError error) {
                mLoadResultCallBack.onError(LoadResultCallBack.ERROR_NET, error.getMessage());
                mLoadFinisCallBack.loadFinish(null);
            }
        }), mActivity);
    }
 
Example 3
Source Project: JianDan_OkHttpWithVolley   Source File: BaseFragment.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void onDestroy() {
    super.onDestroy();
    JDApplication.getRefWatcher(getActivity()).watch(this);
    RequestManager.cancelAll(this);
    ImageLoadProxy.getImageLoader().clearMemoryCache();
}
 
Example 4
Source Project: JianDan_OkHttpWithVolley   Source File: JokeAdapter.java    License: Apache License 2.0 5 votes vote down vote up
private void loadData() {
    RequestManager.addRequest(new Request4Joke(Joke.getRequestUrl(page),
            new Response.Listener<ArrayList<Joke>>
                    () {
                @Override
                public void onResponse(ArrayList<Joke> response) {
                    getCommentCounts(response);
                }
            }, new Response.ErrorListener() {
        @Override
        public void onErrorResponse(VolleyError error) {
            mLoadFinisCallBack.loadFinish(null);
        }
    }), mActivity);
}
 
Example 5
Source Project: JianDan_OkHttpWithVolley   Source File: PictureAdapter.java    License: Apache License 2.0 5 votes vote down vote up
private void getCommentCounts(final ArrayList<Picture> pictures) {

        StringBuilder sb = new StringBuilder();
        for (Picture joke : pictures) {
            sb.append("comment-" + joke.getComment_ID() + ",");
        }

        RequestManager.addRequest(new Request4CommentCounts(CommentNumber.getCommentCountsURL(sb.toString()), new Response
                .Listener<ArrayList<CommentNumber>>() {

            @Override
            public void onResponse(ArrayList<CommentNumber> response) {

                mLoadResultCallBack.onSuccess(LoadResultCallBack.SUCCESS_OK, null);
                mLoadFinisCallBack.loadFinish(null);

                for (int i = 0; i < pictures.size(); i++) {
                    pictures.get(i).setComment_counts(response.get(i).getComments() + "");
                }
                if (page == 1) {
                    PictureAdapter.this.pictures.clear();
                    PictureCache.getInstance(mActivity).clearAllCache();
                }
                PictureAdapter.this.pictures.addAll(pictures);
                notifyDataSetChanged();
                //加载完毕后缓存
                PictureCache.getInstance(mActivity).addResultCache(JSONParser.toString
                        (pictures), page);
            }
        }, new Response.ErrorListener() {
            @Override
            public void onErrorResponse(VolleyError error) {
                ShowToast.Short(ConstantString.LOAD_FAILED);
                mLoadFinisCallBack.loadFinish(null);
                mLoadResultCallBack.onError(LoadResultCallBack.ERROR_NET, error.getMessage());
            }
        }
        ), mActivity);
    }
 
Example 6
Source Project: JianDan_OkHttpWithVolley   Source File: VideoAdapter.java    License: Apache License 2.0 5 votes vote down vote up
private void loadData() {

        RequestManager.addRequest(new Request4Video(Video.getUrlVideos(page),
                new Response.Listener<ArrayList<Video>>() {
                    @Override
                    public void onResponse(ArrayList<Video> response) {
                        getCommentCounts(response);
                    }
                }, new Response.ErrorListener() {
            @Override
            public void onErrorResponse(VolleyError error) {
                mLoadFinisCallBack.loadFinish(null);
            }
        }), mActivity);
    }
 
Example 7
Source Project: JianDan   Source File: BaseFragment.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void onDestroy() {
    super.onDestroy();
    JDApplication.getRefWatcher(getActivity()).watch(this);
    RequestManager.cancelAll(this);
    ImageLoadProxy.getImageLoader().clearMemoryCache();
}
 
Example 8
Source Project: JianDan   Source File: JokeAdapter.java    License: Apache License 2.0 5 votes vote down vote up
private void loadData() {
    RequestManager.addRequest(new Request4Joke(Joke.getRequestUrl(page),
            new Response.Listener<ArrayList<Joke>>
                    () {
                @Override
                public void onResponse(ArrayList<Joke> response) {
                    getCommentCounts(response);
                }
            }, new Response.ErrorListener() {
        @Override
        public void onErrorResponse(VolleyError error) {
            mLoadFinisCallBack.loadFinish(null);
        }
    }), mActivity);
}
 
Example 9
Source Project: JianDan   Source File: PictureAdapter.java    License: Apache License 2.0 5 votes vote down vote up
private void getCommentCounts(final ArrayList<Picture> pictures) {

        StringBuilder sb = new StringBuilder();
        for (Picture joke : pictures) {
            sb.append("comment-" + joke.getComment_ID() + ",");
        }

        RequestManager.addRequest(new Request4CommentCounts(CommentNumber.getCommentCountsURL(sb.toString()), new Response
                .Listener<ArrayList<CommentNumber>>() {

            @Override
            public void onResponse(ArrayList<CommentNumber> response) {

                mLoadResultCallBack.onSuccess(LoadResultCallBack.SUCCESS_OK, null);
                mLoadFinisCallBack.loadFinish(null);

                for (int i = 0; i < pictures.size(); i++) {
                    pictures.get(i).setComment_counts(response.get(i).getComments() + "");
                }
                if (page == 1) {
                    PictureAdapter.this.pictures.clear();
                    PictureCache.getInstance(mActivity).clearAllCache();
                }
                PictureAdapter.this.pictures.addAll(pictures);
                notifyDataSetChanged();
                //加载完毕后缓存
                PictureCache.getInstance(mActivity).addResultCache(JSONParser.toString
                        (pictures), page);
            }
        }, new Response.ErrorListener() {
            @Override
            public void onErrorResponse(VolleyError error) {
                ShowToast.Short(ConstantString.LOAD_FAILED);
                mLoadFinisCallBack.loadFinish(null);
                mLoadResultCallBack.onError(LoadResultCallBack.ERROR_NET, error.getMessage());
            }
        }
        ), mActivity);
    }
 
Example 10
Source Project: JianDan   Source File: VideoAdapter.java    License: Apache License 2.0 5 votes vote down vote up
private void loadData() {

        RequestManager.addRequest(new Request4Video(Video.getUrlVideos(page),
                new Response.Listener<ArrayList<Video>>() {
                    @Override
                    public void onResponse(ArrayList<Video> response) {
                        getCommentCounts(response);
                    }
                }, new Response.ErrorListener() {
            @Override
            public void onErrorResponse(VolleyError error) {
                mLoadFinisCallBack.loadFinish(null);
            }
        }), mActivity);
    }
 
Example 11
Source Project: JianDan_OkHttp   Source File: BaseFragment.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void onDestroy() {
    super.onDestroy();
    JDApplication.getRefWatcher(getActivity()).watch(this);
    RequestManager.cancelAll(this);
    ImageLoadProxy.getImageLoader().clearMemoryCache();
}
 
Example 12
Source Project: JianDan_OkHttpWithVolley   Source File: BaseActivity.java    License: Apache License 2.0 4 votes vote down vote up
@Override
protected void onDestroy() {
    super.onDestroy();
    JDApplication.getRefWatcher(this).watch(this);
    RequestManager.cancelAll(this);
}
 
Example 13
Source Project: JianDan_OkHttpWithVolley   Source File: BaseActivity.java    License: Apache License 2.0 4 votes vote down vote up
public void executeRequest(Request<?> request) {
    RequestManager.addRequest(request, this);
}
 
Example 14
Source Project: JianDan_OkHttpWithVolley   Source File: BaseFragment.java    License: Apache License 2.0 4 votes vote down vote up
protected void executeRequest(Request request) {
    RequestManager.addRequest(request, this);
}
 
Example 15
Source Project: JianDan_OkHttpWithVolley   Source File: JokeAdapter.java    License: Apache License 2.0 4 votes vote down vote up
private void getCommentCounts(final ArrayList<Joke> jokes) {

        StringBuilder sb = new StringBuilder();
        for (Joke joke : jokes) {
            sb.append("comment-" + joke.getComment_ID() + ",");
        }

        String url = sb.toString();
        if (url.endsWith(",")) {
            url = url.substring(0, url.length() - 1);
        }

        RequestManager.addRequest(new Request4CommentCounts(CommentNumber.getCommentCountsURL(url), new Response
                .Listener<ArrayList<CommentNumber>>() {

            @Override
            public void onResponse(ArrayList<CommentNumber> response) {

                for (int i = 0; i < jokes.size(); i++) {
                    jokes.get(i).setComment_counts(response.get(i).getComments() + "");
                }

                if (page == 1) {
                    mJokes.clear();
                    //首次正常加载之后,清空之前的缓存
                    JokeCache.getInstance(mActivity).clearAllCache();
                }

                mJokes.addAll(jokes);
                notifyDataSetChanged();

                //加载完毕后缓存
                JokeCache.getInstance(mActivity).addResultCache(JSONParser.toString(jokes),
                        page);
                mLoadFinisCallBack.loadFinish(null);
                mLoadResultCallBack.onSuccess(LoadResultCallBack.SUCCESS_OK, null);

            }
        }, new Response.ErrorListener() {
            @Override
            public void onErrorResponse(VolleyError error) {
                mLoadResultCallBack.onError(LoadResultCallBack.ERROR_NET, error.getMessage());
                mLoadFinisCallBack.loadFinish(null);
            }
        }
        ), mActivity);

    }
 
Example 16
Source Project: JianDan_OkHttpWithVolley   Source File: FreshNewsAdapter.java    License: Apache License 2.0 4 votes vote down vote up
private void loadDataByNetworkType() {

        if (NetWorkUtil.isNetWorkConnected(mActivity)) {
            RequestManager.addRequest(new Request4FreshNews(FreshNews.getUrlFreshNews(page),
                    new Response.Listener<ArrayList<FreshNews>>() {
                        @Override
                        public void onResponse(ArrayList<FreshNews> response) {

                            mLoadResultCallBack.onSuccess(LoadResultCallBack.SUCCESS_OK, null);
                            mLoadFinisCallBack.loadFinish(null);

                            if (page == 1) {
                                mFreshNews.clear();
                                FreshNewsCache.getInstance(mActivity).clearAllCache();
                            }

                            mFreshNews.addAll(response);
                            notifyDataSetChanged();

                            FreshNewsCache.getInstance(mActivity).addResultCache(JSONParser.toString(response),
                                    page);
                        }
                    }, new Response.ErrorListener() {
                @Override
                public void onErrorResponse(VolleyError error) {
                    mLoadResultCallBack.onError(LoadResultCallBack.ERROR_NET, error.getMessage());
                    mLoadFinisCallBack.loadFinish(null);
                }
            }), mActivity);
        } else {
            mLoadResultCallBack.onSuccess(LoadResultCallBack.SUCCESS_OK, null);
            mLoadFinisCallBack.loadFinish(null);

            if (page == 1) {
                mFreshNews.clear();
                ShowToast.Short(ConstantString.LOAD_NO_NETWORK);
            }

            mFreshNews.addAll(FreshNewsCache.getInstance(mActivity).getCacheByPage(page));
            notifyDataSetChanged();
        }

    }
 
Example 17
Source Project: JianDan_OkHttpWithVolley   Source File: VideoAdapter.java    License: Apache License 2.0 4 votes vote down vote up
private void getCommentCounts(final ArrayList<Video> videos) {

        StringBuilder sb = new StringBuilder();
        for (Video video : videos) {
            sb.append("comment-" + video.getComment_ID() + ",");
        }

        RequestManager.addRequest(new Request4CommentCounts(CommentNumber.getCommentCountsURL(sb.toString()), new Response
                .Listener<ArrayList<CommentNumber>>() {

            @Override
            public void onResponse(ArrayList<CommentNumber> response) {

                mLoadResultCallBack.onSuccess(LoadResultCallBack.SUCCESS_OK, null);
                mLoadFinisCallBack.loadFinish(null);

                for (int i = 0; i < videos.size(); i++) {
                    videos.get(i).setComment_count(response.get(i).getComments() + "");
                }

                if (page == 1) {
                    mVideos.clear();
                    VideoCache.getInstance(mActivity).clearAllCache();
                }

                mVideos.addAll(videos);
                notifyDataSetChanged();
                VideoCache.getInstance(mActivity).addResultCache(JSONParser.toString
                        (videos), page);
                //防止加载不到一页的情况
                if (mVideos.size() < 10) {
                    loadNextPage();
                }
            }
        }, new Response.ErrorListener() {
            @Override
            public void onErrorResponse(VolleyError error) {
                mLoadFinisCallBack.loadFinish(null);
                mLoadResultCallBack.onError(LoadResultCallBack.ERROR_NET, null);
            }
        }
        ), mActivity);

    }
 
Example 18
Source Project: JianDan_OkHttpWithVolley   Source File: CommentAdapter.java    License: Apache License 2.0 4 votes vote down vote up
public void loadData() {
    RequestManager.addRequest(new Request4CommentList(Commentator.getUrlCommentList(thread_key), new Response
            .Listener<ArrayList<Commentator>>() {
        @Override
        public void onResponse(ArrayList<Commentator> response) {

            if (response.size() == 0) {
                mLoadResultCallBack.onSuccess(LoadResultCallBack.SUCCESS_NONE, null);
            } else {
                commentators.clear();

                ArrayList<Commentator> hotCommentator = new ArrayList<>();
                ArrayList<Commentator> normalComment = new ArrayList<>();

                //添加热门评论
                for (Commentator commentator : response) {
                    if (commentator.getTag().equals(Commentator.TAG_HOT)) {
                        hotCommentator.add(commentator);
                    } else {
                        normalComment.add(commentator);
                    }
                }

                //添加热门评论标签
                if (hotCommentator.size() != 0) {
                    Collections.sort(hotCommentator);
                    Commentator hotCommentFlag = new Commentator();
                    hotCommentFlag.setType(Commentator.TYPE_HOT);
                    hotCommentator.add(0, hotCommentFlag);
                    commentators.addAll(hotCommentator);
                }

                //添加最新评论及标签
                if (normalComment.size() != 0) {
                    Commentator newCommentFlag = new Commentator();
                    newCommentFlag.setType(Commentator.TYPE_NEW);
                    commentators.add(newCommentFlag);
                    Collections.sort(normalComment);
                    commentators.addAll(normalComment);
                }

                notifyDataSetChanged();
                mLoadResultCallBack.onSuccess(LoadResultCallBack.SUCCESS_OK, null);
            }
        }
    }, new Response.ErrorListener() {
        @Override
        public void onErrorResponse(VolleyError error) {
            mLoadResultCallBack.onError(LoadResultCallBack.ERROR_NET, error.getMessage());
        }
    }, new LoadFinishCallBack() {
        @Override
        public void loadFinish(Object obj) {
            thread_id = (String) obj;
        }
    }), mActivity);
}
 
Example 19
Source Project: JianDan_OkHttpWithVolley   Source File: TestClass.java    License: Apache License 2.0 4 votes vote down vote up
protected void executeRequest(Request<?> request) {
	RequestManager.addRequest(request, this);
}
 
Example 20
Source Project: JianDan   Source File: BaseActivity.java    License: Apache License 2.0 4 votes vote down vote up
@Override
protected void onDestroy() {
    super.onDestroy();
    JDApplication.getRefWatcher(this).watch(this);
    RequestManager.cancelAll(this);
}
 
Example 21
Source Project: JianDan   Source File: BaseActivity.java    License: Apache License 2.0 4 votes vote down vote up
public void executeRequest(Request<?> request) {
    RequestManager.addRequest(request, this);
}
 
Example 22
Source Project: JianDan   Source File: BaseFragment.java    License: Apache License 2.0 4 votes vote down vote up
protected void executeRequest(Request request) {
    RequestManager.addRequest(request, this);
}
 
Example 23
Source Project: JianDan   Source File: JokeAdapter.java    License: Apache License 2.0 4 votes vote down vote up
private void getCommentCounts(final ArrayList<Joke> jokes) {

        StringBuilder sb = new StringBuilder();
        for (Joke joke : jokes) {
            sb.append("comment-" + joke.getComment_ID() + ",");
        }

        String url = sb.toString();
        if (url.endsWith(",")) {
            url = url.substring(0, url.length() - 1);
        }

        RequestManager.addRequest(new Request4CommentCounts(CommentNumber.getCommentCountsURL(url), new Response
                .Listener<ArrayList<CommentNumber>>() {

            @Override
            public void onResponse(ArrayList<CommentNumber> response) {

                for (int i = 0; i < jokes.size(); i++) {
                    jokes.get(i).setComment_counts(response.get(i).getComments() + "");
                }

                if (page == 1) {
                    mJokes.clear();
                    //首次正常加载之后,清空之前的缓存
                    JokeCache.getInstance(mActivity).clearAllCache();
                }

                mJokes.addAll(jokes);
                notifyDataSetChanged();

                //加载完毕后缓存
                JokeCache.getInstance(mActivity).addResultCache(JSONParser.toString(jokes),
                        page);
                mLoadFinisCallBack.loadFinish(null);
                mLoadResultCallBack.onSuccess(LoadResultCallBack.SUCCESS_OK, null);

            }
        }, new Response.ErrorListener() {
            @Override
            public void onErrorResponse(VolleyError error) {
                mLoadResultCallBack.onError(LoadResultCallBack.ERROR_NET, error.getMessage());
                mLoadFinisCallBack.loadFinish(null);
            }
        }
        ), mActivity);

    }
 
Example 24
Source Project: JianDan   Source File: FreshNewsAdapter.java    License: Apache License 2.0 4 votes vote down vote up
private void loadDataByNetworkType() {

        if (NetWorkUtil.isNetWorkConnected(mActivity)) {
            RequestManager.addRequest(new Request4FreshNews(FreshNews.getUrlFreshNews(page),
                    new Response.Listener<ArrayList<FreshNews>>() {
                        @Override
                        public void onResponse(ArrayList<FreshNews> response) {

                            mLoadResultCallBack.onSuccess(LoadResultCallBack.SUCCESS_OK, null);
                            mLoadFinisCallBack.loadFinish(null);

                            if (page == 1) {
                                mFreshNews.clear();
                                FreshNewsCache.getInstance(mActivity).clearAllCache();
                            }

                            mFreshNews.addAll(response);
                            notifyDataSetChanged();

                            FreshNewsCache.getInstance(mActivity).addResultCache(JSONParser.toString(response),
                                    page);
                        }
                    }, new Response.ErrorListener() {
                @Override
                public void onErrorResponse(VolleyError error) {
                    mLoadResultCallBack.onError(LoadResultCallBack.ERROR_NET, error.getMessage());
                    mLoadFinisCallBack.loadFinish(null);
                }
            }), mActivity);
        } else {
            mLoadResultCallBack.onSuccess(LoadResultCallBack.SUCCESS_OK, null);
            mLoadFinisCallBack.loadFinish(null);

            if (page == 1) {
                mFreshNews.clear();
                ShowToast.Short(ConstantString.LOAD_NO_NETWORK);
            }

            mFreshNews.addAll(FreshNewsCache.getInstance(mActivity).getCacheByPage(page));
            notifyDataSetChanged();
        }

    }
 
Example 25
Source Project: JianDan   Source File: VideoAdapter.java    License: Apache License 2.0 4 votes vote down vote up
private void getCommentCounts(final ArrayList<Video> videos) {

        StringBuilder sb = new StringBuilder();
        for (Video video : videos) {
            sb.append("comment-" + video.getComment_ID() + ",");
        }

        RequestManager.addRequest(new Request4CommentCounts(CommentNumber.getCommentCountsURL(sb.toString()), new Response
                .Listener<ArrayList<CommentNumber>>() {

            @Override
            public void onResponse(ArrayList<CommentNumber> response) {

                mLoadResultCallBack.onSuccess(LoadResultCallBack.SUCCESS_OK, null);
                mLoadFinisCallBack.loadFinish(null);

                for (int i = 0; i < videos.size(); i++) {
                    videos.get(i).setComment_count(response.get(i).getComments() + "");
                }

                if (page == 1) {
                    mVideos.clear();
                    VideoCache.getInstance(mActivity).clearAllCache();
                }

                mVideos.addAll(videos);
                notifyDataSetChanged();
                VideoCache.getInstance(mActivity).addResultCache(JSONParser.toString
                        (videos), page);
                //防止加载不到一页的情况
                if (mVideos.size() < 10) {
                    loadNextPage();
                }
            }
        }, new Response.ErrorListener() {
            @Override
            public void onErrorResponse(VolleyError error) {
                mLoadFinisCallBack.loadFinish(null);
                mLoadResultCallBack.onError(LoadResultCallBack.ERROR_NET, null);
            }
        }
        ), mActivity);

    }
 
Example 26
Source Project: JianDan   Source File: CommentAdapter.java    License: Apache License 2.0 4 votes vote down vote up
public void loadData() {
    RequestManager.addRequest(new Request4CommentList(Commentator.getUrlCommentList(thread_key), new Response
            .Listener<ArrayList<Commentator>>() {
        @Override
        public void onResponse(ArrayList<Commentator> response) {

            if (response.size() == 0) {
                mLoadResultCallBack.onSuccess(LoadResultCallBack.SUCCESS_NONE, null);
            } else {
                commentators.clear();

                ArrayList<Commentator> hotCommentator = new ArrayList<>();
                ArrayList<Commentator> normalComment = new ArrayList<>();

                //添加热门评论
                for (Commentator commentator : response) {
                    if (commentator.getTag().equals(Commentator.TAG_HOT)) {
                        hotCommentator.add(commentator);
                    } else {
                        normalComment.add(commentator);
                    }
                }

                //添加热门评论标签
                if (hotCommentator.size() != 0) {
                    Collections.sort(hotCommentator);
                    Commentator hotCommentFlag = new Commentator();
                    hotCommentFlag.setType(Commentator.TYPE_HOT);
                    hotCommentator.add(0, hotCommentFlag);
                    commentators.addAll(hotCommentator);
                }

                //添加最新评论及标签
                if (normalComment.size() != 0) {
                    Commentator newCommentFlag = new Commentator();
                    newCommentFlag.setType(Commentator.TYPE_NEW);
                    commentators.add(newCommentFlag);
                    Collections.sort(normalComment);
                    commentators.addAll(normalComment);
                }

                notifyDataSetChanged();
                mLoadResultCallBack.onSuccess(LoadResultCallBack.SUCCESS_OK, null);
            }
        }
    }, new Response.ErrorListener() {
        @Override
        public void onErrorResponse(VolleyError error) {
            mLoadResultCallBack.onError(LoadResultCallBack.ERROR_NET, error.getMessage());
        }
    }, new LoadFinishCallBack() {
        @Override
        public void loadFinish(Object obj) {
            thread_id = (String) obj;
        }
    }), mActivity);
}
 
Example 27
Source Project: JianDan   Source File: TestClass.java    License: Apache License 2.0 4 votes vote down vote up
protected void executeRequest(Request<?> request) {
	RequestManager.addRequest(request, this);
}
 
Example 28
Source Project: JianDan_OkHttp   Source File: BaseActivity.java    License: Apache License 2.0 4 votes vote down vote up
@Override
protected void onDestroy() {
    super.onDestroy();
    JDApplication.getRefWatcher(this).watch(this);
    RequestManager.cancelAll(this);
}
 
Example 29
Source Project: JianDan_OkHttp   Source File: BaseActivity.java    License: Apache License 2.0 4 votes vote down vote up
public void executeRequest(Request<?> request) {
    RequestManager.addRequest(request, this);
}
 
Example 30
Source Project: JianDan_OkHttp   Source File: BaseFragment.java    License: Apache License 2.0 4 votes vote down vote up
protected void executeRequest(Request request) {
    RequestManager.addRequest(request, this);
}