Access-Control-Allow-Origin Error At Android 4.1

后端 未结 3 874
心在旅途
心在旅途 2020-12-01 08:39

I have problems with Access-Control-Allow-Origin at Android 4.1

In my application i have some local HTML files and Javascripts which i was using to fetch data from w

3条回答
  •  生来不讨喜
    2020-12-01 09:10

    you need to do something like

    if (Build.VERSION.SDK_INT >= VERSION_CODES.JELLY_BEAN) 
      wv.getSettings().setAllowUniversalAccessFromFileURLs(true);
    

提交回复
热议问题