0

in line 2 below:

when i use httpclient4.1.jar in my libs setRedirectStrategy error removed and laxRedirect error occured (and laxRedirect import also take error)-error(1) below,

when i use httpclient4.2.3, laxredirect error removed and setRedirectStrategy error occured- error(2) below .

what i do? (use 4.1 or 4.2.3, and what chages must be done?)

DefaultHttpClient httpclient = new DefaultHttpClient();
httpclient.setRedirectStrategy(new LaxRedirectStrategy());

imports are:

    import org.apache.http.impl.client.LaxRedirectStrategy;
import org.apache.http.impl.client.DefaultHttpClient;

and errors are:

1- The method setRedirectStrategy(LaxRedirectStrategy) is undefined for the type DefaultHttpClient

2- LaxRedirectStrategy cannot be resolved to a type

1 Answers1

0

The RedirectStrategy was introduced with 4.1 and is now deprecated.So when you included 4.1 jar setRedirectStrategy worked but with 4.2.3 it didn't.

In this case you can't override the system (Android's) implementation.So from here i would suggest you to refer SO questions No. 1,No. 2 and No. 3.

Community
  • 1
  • 1
Sash_KP
  • 5,551
  • 2
  • 25
  • 34