Android NetworkOnMainThreadException inside of AsyncTask

后端 未结 2 1953
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-06 11:44

I have a problem on ICS when I try to use google calendar api. To get a list of events, I have a AsyncTask and inside doInBackground() I make the service calls but still I r

相关标签:
2条回答
  • 2021-01-06 12:27

    Are you testing this on the emulator? For some reason I have the same issue when testing on the emulator while streaming a .mpjeg within AsyncTask; however when I test it on a device it works fine.

    It may be an emulator issue; however it could also be something with ICS (I emulator 4.0.3 but run 2.3.7 CM7b257 on my phone) but give it a try as that could very well be your issue.

    0 讨论(0)
  • 2021-01-06 12:28

    It seems the problem was in the manifest.. I had this attribute in the uses-sdk tag:

    android:targetSdkVersion="10"
    

    After I removed this attribute, the app worked.

    0 讨论(0)
提交回复
热议问题