Saltando entre "Adaptador é desanexado" e "Sem conexão envolvida" com HttpClient
Então, como eu disse eu estou indo e voltando entre esses dois erros ao tentar executarHttpClient.execute(HttpPost)
. ObtendoIllegalStateException
public class NetMethods {
private static HttpClient client = new DefaultHttpClient();
public static void getStuff() {
ArrayList<Alarm> alarms = new ArrayList<Alarm>();
HttpPost post = HttpPostFactory.getHttpPost("GetStuff");
StringBuilder builder = new StringBuilder();
HttpResponse response = client.execute(post); // Exception thrown here
...
Além disso, o meu MttpPostFactory só tem esse
import org.apache.http.client.methods.HttpPost;
public class HttpPostFactory {
private static final String url = "http://example.com/ExampleFolder/";
public static HttpPost getHttpPost(String s) {
return new HttpPost(url + s);
}
}