I had enabled a proxy in my application through a ProxySettings class, but now I want to disable it so that the ON / OFF proxy button should work.
I searched and tried a lot, but I could not find a way to stop the proxy and continue with regular Wi-Fi...
I tried the following code from ProxySettings class that I got from Stack Overflow:
public static void resetProxy(Context ctx) throws Exception
{
Object requestQueueObject = getRequestQueue(ctx);
if(requestQueueObject != null)
{
setDeclaredField(requestQueueObject, "mProxyHost", null);
}
}
How can I fix this problem?