• Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
sam liya
Ranch Hand
Posts: 1271
  • 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?
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • 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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!