jar - App works fine in android 2.3.7 and not in 4.1.2 -
i have app works fine in android 2.3.4, 2.3.6 , 2.3.7 doesn´t in android 4.1.2 or 4.2.2 (i have no more devices)
the app calls jar file returns result, when test app in 2.3.7 make call jar , takes result when android 4.1.2 forces close. it´s quite weird because difference os because app same.
the jar file makes call internet, don´t think mistake
thanks again everybody!
the jar file makes call internet, don´t think mistake
=> sorry dude problem here, said app working fine in < 2.3 versions not in >2.3, reasons behind failure networkonmainthreadexception
.
now, why exception being raised whenever run app in >2.3 version device?
=> networkonmainthreadexception
occurs whenever application attempts perform networking operation on main thread.
solutions:
below 2 solutions resolve issue:
1) standard way make webservice call implementing asynctask.
2) lazy way of handling turn check of:
strictmode.threadpolicy policy = new strictmode.threadpolicy.builder().permitall().build(); strictmode.setthreadpolicy(policy);
Comments
Post a Comment