NetworkOnMainThreadException error in jellybean
This question already has an answer here:
From Android API v15, it requires no heavy process working on main thread. So you should move your logic to another thread like bellow source code:
new Thread(new Runnable() {
public void run() {
// your logic
}
}).start();
More information please refer: Responsiveness
just add this code in oncreate on which activity u call Asynck.
code:-
StrictMode.ThreadPolicy policy =
new StrictMode.ThreadPolicy.Builder().permitAll().build();
StrictMode.setThreadPolicy(policy);
链接地址: http://www.djcxy.com/p/29536.html