Adding the uses-sdk fields in Androids manifest file causes crash

前端 未结 2 1007
隐瞒了意图╮
隐瞒了意图╮ 2021-01-23 16:21

For some reason, when adding the uses-sdk fields in Android\'s manifest file causes crash. I\'ve not had this happen before but I can\'t get rid of it now.

The relevant

2条回答
  •  时光说笑
    2021-01-23 17:03

    As @Sameer said, you are doing network calls in the core of your Activity. You should NEVER do that. All the code of your activity run on the main thread : the one that is used for the UI. You should not make any heavy calculation on that thread : it takes resources away from the UI, making it lag. An http call is even worse : as long as you don't have the response the UI is blocked.

    Implement your network calls in an AsyncTask.

提交回复
热议问题