错误:StrictMode $ AndroidBlockGuardPolicy.onNetwork

 

you have to insert 2 lines "StrictMode" on MainActivity Class, example's below:

 

在onCreate()方法下一行添加StrictMode

例子:
public class MainActivity extends Activity {
 
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        //come here
        StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
        StrictMode.setThreadPolicy(policy);
 
    }
}
posted @ 2016-11-11 18:12  8995  阅读(1486)  评论(0编辑  收藏  举报