Win a copy of Classic Computer Science Problems in Swift this week in the iOS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

i am getting networkonmainthreadexception when i try to download the file  RSS feed

 
Ranch Hand
Posts: 1287
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a app which downloads the pdf file from url.
when i ran this app in android 2.3(API 10) version phone its working fine.
but when i ran this app in a Android Tab 4.0(API 14) it gives me below exception



I check and found that this exception occurs when we run network related operation in main thread.So how it rans on ANdroid 2.3 version phone?
 
Rancher
Posts: 42975
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
StrictMode was expanded in Android 3. You need to allow network activity on the main thread now IIRC.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!