java to android error in eclipse -
i have function in java , want use in eclipse in android project:
public string submitform() { defaulthttpclient httpclient = new defaulthttpclient(); httpclient.setredirectstrategy(new laxredirectstrategy()); cookiestore cookiestore = new basiccookiestore(); httpcontext localcontext = new basichttpcontext(); localcontext.setattribute(clientcontext.cookie_store, cookiestore); httpclient.getparams().setparameter(clientpnames.allow_circular_redirects, true); try { (basketitem item: getmodel().getitems()) { ioutil.getconentasstring("bziran_path" + "/add2card.php?vendors=" + "item.getdetail().getvendors()" + "&id=" + "item.getdetail().getid()", httpclient, localcontext); } } catch (clientprotocolexception e) { // todo auto-generated catch block e.printstacktrace(); return null; } catch (ioexception e) { // todo auto-generated catch block e.printstacktrace(); return null; }
but eclise me error in line 3,4:
httpclient.setredirectstrategy(new laxredirectstrategy()); cookiestore cookiestore = new basiccookiestore();
can me fix them:
line3 error: laxredirectstrategy cannot resolved type
line4 error: type mismatch: cannot convert basiccookiestore cookiestore
here import:
import java.io.ioexception; import java.net.cookiestore; import java.util.hashmap; import org.apache.commons.io.ioutils; import java.lang.object; import org.apache.http.client.clientprotocolexception; import org.apache.http.client.params.clientpnames; import org.apache.http.client.protocol.clientcontext; import org.apache.http.impl.client.basiccookiestore; import org.apache.http.impl.client.defaulthttpclient; import org.apache.http.protocol.basichttpcontext; import org.apache.http.protocol.httpcontext; import android.support.v7.app.actionbaractivity; import android.os.bundle; import android.view.menu; import android.view.menuitem;
import laxredirectstrategy
class
import org.apache.http.impl.client.laxredirectstrategy
import class basiccookiestore
, org.apache.http.client.cookiestore
import org.apache.http.impl.client.basiccookiestore import org.apache.http.client.cookiestore
remove
import java.net.cookiestore;
Comments
Post a Comment