0

对于登录,我正在使用服装警报框。这是第一次很好地工作。但是在第二次(我的意思是:登录-有效,注销-有效,注销后第二次登录-失败)它说:

05-30 15:45:11.664: W/System.err(3228): org.apache.http.client.ClientProtocolException
05-30 15:45:11.664: W/System.err(3228):     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:557)
05-30 15:45:11.675: W/System.err(3228):     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)
05-30 15:45:11.675: W/System.err(3228):     at com.loopj.android.http.AsyncHttpRequest.makeRequest(AsyncHttpRequest.java:76)
05-30 15:45:11.675: W/System.err(3228):     at com.loopj.android.http.AsyncHttpRequest.makeRequestWithRetries(AsyncHttpRequest.java:95)
05-30 15:45:11.675: W/System.err(3228):     at com.loopj.android.http.AsyncHttpRequest.run(AsyncHttpRequest.java:57)
05-30 15:45:11.694: W/System.err(3228):     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:390)
05-30 15:45:11.694: W/System.err(3228):     at java.util.concurrent.FutureTask.run(FutureTask.java:234)
05-30 15:45:11.694: W/System.err(3228):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)

过去是否有人遇到过同样的问题?第一次登录和注销效果很好,但第二次完全失败:/

编辑:

public static void postRequestLogin(String url, RequestParams params) {
        client.post(url, params, new AsyncHttpResponseHandler() {
            @Override
            public void onSuccess(String response) {
                    getRequestLogin(MainActivity.baseUrl + "index.php");
                return;
            }

             @Override
             public void onFailure(Throwable e, String errorResponse)
                {
                    dialog.hide();
                    Toast.makeText(context, "Connection failed! Error: " + e.getMessage(), Toast.LENGTH_SHORT).show();
                    MainActivity.myCookieStore.clear();
                    dialog.show();
                    return;
                }
        });
    }
4

0 回答 0