5

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?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Noman
  • 4,049
  • 10
  • 38
  • 59

0 Answers0