HTTPPOST: InputDispatcher: "Der Kanal ist nicht wiederum kaputt und wird entsorgt!" auf Nexus 7Java

Java-Forum
Anonymous
 HTTPPOST: InputDispatcher: "Der Kanal ist nicht wiederum kaputt und wird entsorgt!" auf Nexus 7

Post by Anonymous »

auf Nexus 7 (4.3) und nicht auf meinem älteren Gerät, LG Optimus 3D (Android 2.2),
Wenn ich httppost mache, bekomme ich diesen < /p>

E /InputDispatcher ﹕ Kanal '4273f7b0 ... MainActivity (Server)' ~ ~ kanal ist unfeuer, und es wird nicht gelöst und wird nicht gelöst und wird nicht gelöst und wird nicht gelöst und wird nicht gelöst und wird nicht gelöst. /> Personen haben ein mögliches Speicherleck erwähnt. Sehen **. Dieses Problem tritt jedoch sofort beim Start auf, wenn ich den HTTPPOST probiere. Ist es wahrscheinlich immer noch ein Speicherleck?public void server_addUserGetId()
{
String url = GS.baseUrl() + "/users";
HttpPost theHttpPost = new HttpPost(url);

List nameValuePairs = new ArrayList();
nameValuePairs.add(new BasicNameValuePair("dId", s_UserInfo.getInstance().m_device_id ));
try {
theHttpPost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
HttpPostAsync theHttpPostAsync = new HttpPostAsync(new OnPostExecuteHandler() {
@Override
public void handlePostExecute(Object oHttpResponse) {
HttpResponse theHttpResponse = (HttpResponse) oHttpResponse;
JSONObject jo = GS.getJSONObject(theHttpResponse.getEntity());
try {
s_UserInfo.getInstance().m_user_id = jo.getString("_id");
} catch (JSONException e) {
e.printStackTrace();
}
}
});
theHttpPostAsync.execute(theHttpPost);
return;
}
< /code>

Hier ist meine httppostasync -Aufgabe: < /p>

public class HttpPostAsync extends AsyncTask
{
private HttpPost m_HttpPost;
private HttpResponse m_HttpResponse;

private OnPostExecuteHandler m_OnPostExecuteHandler;
public HttpPostAsync(OnPostExecuteHandler listener)
{
m_OnPostExecuteHandler = listener;
}

protected HttpResponse doInBackground(HttpPost ... args)
{
m_HttpPost = args[0];
if(GS.dl>5) Log.d("GRA: HttpPostAsync", "doInBackground: Thread.currentThread().getId()=" + Thread.currentThread().getId());
m_HttpResponse = visit(m_HttpPost);
return m_HttpResponse;
}

protected void onProgressUpdate(Integer... progress) {
}

protected void onPostExecute(Long result) {
if(GS.dl>5) Log.d("GRA: HttpPostAsync", "onPostExecute: Thread.currentThread().getId()=" + Thread.currentThread().getId());
if(GS.dl>5) Log.d("GRA: HttpPostAsync", "onPostExecute: result=" + result);
//if(GS.dl>5) Log.d("GRA: HttpPostAsync", "onPostExecute: m_HttpEntity="+m_HttpEntity);
m_OnPostExecuteHandler.handlePostExecute(m_HttpResponse);
}

public HttpResponse visit(HttpPost theHttpPost)
{
HttpResponse response = null;
try {
// Create a new HttpClient and Post Header
HttpClient httpclient = new DefaultHttpClient();
// Execute HTTP Post Request
response = httpclient.execute(theHttpPost);
} catch (IOException e) {
e.printStackTrace();
Log.d("HttpPostAsync.java", "IOException e=" + e);
// TODO Auto-generated catch block
}
return response;
}
}
< /code>

Ideen?List nameValuePairs = new ArrayList(1);
< /code>

*: Antworten Sie also, dass dies nicht vollständig in Beziehung steht /Hilfe:
App hat aufgehört, Android zu arbeiten < /p>

** Speicherleck zugeordnet? http://android-developers.blogspot.com/ ... droid.html

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post