android支付宝系统繁忙,支付宝支付 系统繁忙,请稍后再试 62008 难道没人碰到过吗...

Android Document文档如下所示,提到建议使用 IntentService 的 onHandleIntent()函数管理任务,而不是简单的启动一个线程来处理:

Should you use a service or a thread? A service is simply a component that can run in the background even when the user is not interacting with your application. Thus, you should create a service only if that is what you need. If you need to perform work outside your main thread, but only while the user is interacting with your application, then you should probably instead create a new thread and not a service. For example, if you want to play some music, but only while your activity is running, you might create a thread in onCreate(), start running it in onStart(), then stop it in onStop(). Also consider using AsyncTask or HandlerThread, instead of the traditional Thread class. See the Processes and Threading document for more information about threads. Remember that if you do use a service, it still runs in your application's main thread by default, so you should still create a new thread within the service if it performs intensive or blocking operations.

网上也有人说 最好在accept()blocked 的时候关闭 ServerSocket ,就不会发生SocketTimeoutException了,不知道对不对,但都是dcloud内部的io.dcloud.net.http.MiniServer$Server的处理模式,不知道能否修改,求助大拿

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值