Bouncen zwischen "Adapter ist getrennt" und "Keine unterbrochene Verbindung" mit HttpClient
Also, wie gesagt, ich hüpfe zwischen diesen beiden Fehlern hin und her, wenn ich versuche zu rennenHttpClient.execute(HttpPost)
. BekommenIllegalStateException
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
...
Auch meine MttpPostFactory hat genau dies
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);
}
}