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 web services. Until trying Android 4.1 there was no problem but after trying at Android 4.1 i got this error.
I read lots of documents but i couldn't find a way to solve this problem.
@I am Developer and the others who are facing the same problem.
Slushis solution works fine. But if you want to compile against and support systems below API11 you have to add the following:
This will load and invoke the method at runtime, so you can compile with e.g. Android 2.3.3.
you need to do something like
Are your web services hosting from the same domain ? I used to get this error while making an ajax call to a service under a different domain. If you have control on the web service, you can set Access-Control-Allow-Origin: * in the header, (although this way is not a secure way of doing so.)