java.net.SocketException: sendto failed: ECONNRESET (Connection reset by peer)

北慕城南 提交于 2019-12-01 08:43:04

Hi am also facing the same problme.Now resolved using below code.I hope it will also help you.. try it....

Put this below code within onCreate()

 @Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_upload_documents);

    if (android.os.Build.VERSION.SDK_INT > 9) {
        StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder()
                .permitAll().build();
        StrictMode.setThreadPolicy(policy);
    }

   //Statement or Controls Declaration or your code

}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!