API.AI: How to stop AsyncTask on click of the AIButton?

前端 未结 4 2040
借酒劲吻你
借酒劲吻你 2021-01-18 10:37

I’m using AIButton in my app and I have a AsyncTask which gets executed after AIButton is clicked and receives some command and AsyncTask sometimes

4条回答
  •  天涯浪人
    2021-01-18 11:01

    if you want to cancel the AsyncTask class translate.cancel()

    if you want to cancel the server request I recommend to use OKHTTP has a cancel request feature

提交回复
热议问题