No Network Security Config specified, using platform default

前端 未结 4 1813
攒了一身酷
攒了一身酷 2021-01-06 05:37

I\'m trying to print a list of values in ListView from a webpage. I have the two permission



        
4条回答
  •  感情败类
    2021-01-06 06:20

    I had the same issue and after debugging it further, I found it a thread issue. I changed onCreate method as below and it works fine. No playing Network Security Configuration file.

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_main);
    
            if (android.os.Build.VERSION.SDK_INT > 9)
            {
               StrictMode.ThreadPolicy policy = new 
               StrictMode.ThreadPolicy.Builder().permitAll().build();
               StrictMode.setThreadPolicy(policy);
            }
      ....
      ....
      }
    

    Hope it helps.

提交回复
热议问题