简体   繁体   中英

Starting new thread for every new class/activity java android

I wrote program that work fine. Every class is one new activity, that show you some information from web... for example contacts-activity.class takes information from json-contacts and invoices-activity.class pull info from json-invoices out. But I think my code doesn´t look like good, because in every class I start new Thread for network operations to pull my data from web-server.
How can I try to do it better?

将您的业务和线程逻辑移到单独的类中,并与您的Activities交互。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM