silencedut / taskscheduler Goto Github PK
View Code? Open in Web Editor NEWA concise,practical async library for Android project,already was used in million devices
A concise,practical async library for Android project,already was used in million devices
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() {}
就不会报错呢?
我在一个图片列表里不断的TaskScheduler.execute(new Task())执行一个下载图片的任务
然后就crach了,是我使用姿势不对么
version:2.4.0
Similar to how in Asynctask I can pass values, I would like to do the same here instead of created global values or retrieving the value from the db. How do I do that?
不支持像Executor.schedule(runnable, delay, timeUnit)的延时任务?
请问下是弃用了吗还是开发中?
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才能更新 那这样和一般的异步有什么区别哦
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.