Giter VIP home page Giter VIP logo

taskscheduler's Issues

咨询~

TaskScheduler.execute(new Task() {
@OverRide
public boolean doInBackground() throws InterruptedException {

                                       }
                @Override
                public void onSuccess(boolean result) {
                    /**UI线程*/
                                   }
            });

为什么这样写TaskScheduler.execute(new Task() {}
中的new Task() 就会报错。
而 Task task = new Task() {}
就不会报错呢?

支持延时任务

不支持像Executor.schedule(runnable, delay, timeUnit)的延时任务?

As a Service

How can this library be used as a background service doing a repeated task?

请教

TaskScheduler.execute(() -> {
List allCity = DBUtils.getCityManager().queryLike(keyword);
if (ObjectUtils.isNotEmpty(allCity)) {
List cityInfoDatas = new ArrayList<>();
for (City city : allCity) {
cityInfoDatas.add(new CityInfoData(city.country, city.countryEn, city.cityId));
}
mView.showMatchCitys(cityInfoDatas);
}
});
我在线程里面去获取数据库的信息。
mView.showMatchCitys(cityInfoDatas)//UI更新
就报错
Only the original thread that created a view hierarchy can touch its views
不能在线程更新UI了,是不是还得用handler才能更新 那这样和一般的异步有什么区别哦

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.