1

我们正在尝试在接近雷达时接收特定事件......但是 sygic sdk 没有将此事件发送到我们的回调,有什么想法吗?

我的代码:

private val mApiCallback: ApiCallback = object : ApiCallback {
        override fun onServiceDisconnected() {}
        
        override fun onServiceConnected() {
            try {
                mApi?.registerCallback()
            } catch (e: RemoteException) {
                Log.e("RegisterCallback", "Error code:" + e.message)
            }
        }

        override fun onEvent(event: Int, data: String?) {
            var show = false
            when (event) {
                ApiEvents.EVENT_RADAR_WARNING -> show = true
            }
            // Handle events
        }
    }

override fun onCreate(
    savedInstanceState: Bundle?
) {
    super.onCreate(savedInstanceState)
    mApi = Api.init(applicationContext,  "com.sygic.fleet",     "com.sygic.fleet.SygicService", mApiCallback)
    mApi?.connect()
    mEvents[ApiEvents.EVENT_ROUTE_FINISH] = "Radar próximo";
}
4

0 回答 0