Android XMPP connection is not persistant - asmack library even running in a separate thread

前端 未结 2 670
闹比i
闹比i 2021-01-15 20:49

I am developing an Android chat app which uses asmack library. What I observe is that the XMPP connection beocmes disconnected after a particular interval of time. ( This al

2条回答
  •  失恋的感觉
    2021-01-15 21:07

    It will be better to use AsyncTask for connection in your code rather than using Thread.It is not recommended to use Thread in Android.Try AsyncTask, it is used for all connection related purposes.

    class ConnectServer extends AsyncTask {
    
    }
    

提交回复
热议问题