如何使用asynctask(android)

对所有人都好我有一个问题,我需要知道如何使用asynctask中的代码,如果有人可以向我解释如何转移我在其中的代码,我对asynctask的理解不是很好我非常感谢asynctask的处理程序。


        handler.postDelayed(new Runnable() {
            @Override
            public void run() {

                if (polylanelist2.size() > 1 ){

                    if (index < polylanelist2.size() - 1) {
                        index++;
                        next = index + 1;
                    }
                     if (index < polylanelist2.size() - 1) {
                         starposition = polylanelist2.get(index);
                         endposition = polylanelist2.get(next);
                     }

                    valueAnimator = ValueAnimator.ofFloat(0,1);
                    valueAnimator.setDuration(3000);
                    valueAnimator.setInterpolator(new LinearInterpolator());
                    valueAnimator.addUpdateListener(new ValueAnimator.AnimatorupdateListener() {
                        @Override
                        public void onAnimationUpdate(ValueAnimator animation) {
                            v = valueAnimator.getanimatedFraction();
                            logg = v * endposition.longitude + (1 - v)
                                    * starposition.longitude;
                            latt = v * endposition.latitude + (1 - v)
                                    * starposition.latitude;

                            newpos = new LatLng(latt,logg);
                            marker.setPosition(newpos);
                            marker.setanchor(0.5f,0.5f);
                            marker.setRotation(getBearing(starposition,newpos));

                        }
                    });

                    valueAnimator.start();
                    handler.postDelayed(this,3000);
            }
            }
        },3000);
xqhong0826 回答:如何使用asynctask(android)

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3157508.html

大家都在问