Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new AjaxCallBack<File>() onLoading方法不执行,只执行onSuccess方法,什么问题? #92

Closed
codingpp opened this issue Mar 12, 2015 · 2 comments

Comments

@codingpp
Copy link

public void onLoading(long count,long current){};
public void onSuccess(T t){};
public void onFailure(Throwable t,int errorNo ,String strMsg){};

@bacy
Copy link

bacy commented Mar 13, 2015

你是下载方法吗?文件有多大?

@javaDashuaiAndroid
Copy link

dHttp.download(
"http://yinyueshiting.baidu.com/data2/music/124383790/124380645248400128.mp3?xcode=2f36611e0d3ba556dd6ee9dbca2422d52f7167fd0a01384c",
DFileUtil.getExternalStorageDirectory() + "/congcongnanian.mp3",
new AjaxCallBack() {

                public void onSuccess(File t) {

                    Toast.makeText(DHttpActivity.this,
                            "歌曲下载完成,路径是" + t.getAbsolutePath(),
                            Toast.LENGTH_SHORT).show();
                };

                public void onLoading(long count, long current) {

                    textView.setText("正在下载: "
                            + (int) (((float) (current * 1.0) / count * 1.0) * 100)
                            + " %");

                };

                public void onFailure(Throwable t, int errorNo,
                        String strMsg) {

                    t.printStackTrace();

                    Toast.makeText(DHttpActivity.this, "歌曲下载失败",
                            Toast.LENGTH_SHORT).show();
                };

            }.progress(true, 1000));

.progress(true, 1000));

@codingpp codingpp closed this as completed Feb 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants