开发者

Update setProgress during AJAX requests

I have a WebView in my progress which updates without issue during page requests, but I would like to have onProgressCh开发者_如何学Goanged work during AJAX requests. Is this possible?

public void onProgressChanged(WebView view, int progress) {
                activity.setProgress(progress * 100);

                // Done?
                if ( progress == 100 )
                {
                    // Set
                        setProgressBarIndeterminateVisibility(false);
                }
              }


Yes you can do that using Javascript interface. Check this documentation for more information on how to call native android methods from javascript.

You can write your methods to set the progressbar indeterminate visibility to true/false from these methods and call these methods from your Ajax calls.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜