| | |
| | | import android.content.Intent |
| | | import android.os.Handler |
| | | import android.os.Looper |
| | | import android.util.Log |
| | | import cn.sinata.xldutils.netstatus.NetUtils |
| | | import cn.sinata.xldutils.utils.toast |
| | | import com.google.gson.Gson |
| | |
| | | */ |
| | | class MoneyBroadCastReceiver : BroadcastReceiver() { |
| | | override fun onReceive(contexts: Context?, intent: Intent?) { |
| | | MyApplication.upLog("收到广播,Action:${intent?.action}") |
| | | Log.e("MoneyBroadCastReceiver","收到广播,Action:${intent?.action}") |
| | | if (intent == null && contexts == null) { |
| | | toast("内容获取为空,广播接收消息错误") |
| | | return |
| | |
| | | when (intent!!.action) { |
| | | "wisdom.intent.action.ledLight" -> { |
| | | val isHeavy = intent!!.getBooleanExtra("isHeavy", true) |
| | | MyApplication.upLog("广播内容,isHeavy:${isHeavy}") |
| | | if (isHeavy) { |
| | | callStatue(contexts!!, 5) //代表让订单到进行中 |
| | | } |
| | |
| | | companion object { |
| | | fun callStatue(contexts: Context, i: Int) { |
| | | if (MyApplication.currentOrderId.isEmpty()) { |
| | | MyApplication.upLog("callStatue error,MyApplication.currentOrderId.isEmpty") |
| | | toast("没有进行中的订单,无法开始") |
| | | return |
| | | } |