post execute对asynctask不起作用

时间:2014-09-11 13:56:43

标签: android android-asynctask

我所拥有的是AsyncTask课程:

private class AsyncCallWS extends AsyncTask<Void, Void, Void> {

    protected void onPostExecute(Void result) {
        try {
            //Log.e(" Customer_Id=masterrs.get(m).getCustomerId()", rs.get(m).getCustomerId());
            Toast.makeText(CartList.this, "order has been send ", Toast.LENGTH_SHORT).show();
        } catch(Exception e) {
            e.printStackTrace();
        }
    }

    //Make Progress Bar visible
    protected void onPreExecute() {

    }

    @Override
    protected Void doInBackground(Void... params) {
         for (int m = 0; m < rs.size(); m++) {
             Log.e("Customer_Id",rs.get(m).getCustomerId()+"");
             Log.e("Customer_Name",rs.get(m).getCustomerName()+"");
             Customer_Id=rs.get(m).getCustomerId();
             Customer_Name=rs.get(m).getCustomerName();
             Category=rs.get(m).getCategory();
             Item_Id=rs.get(m).getItemId();
             Quantity=rs.get(m).getItemQuantity();
             Bounce=rs.get(m).getExtra();
             Order_Date=rs.get(m).getDate();


            try {
               //Log.e(" Customer_Id=masterrs.get(m).getCustomerId()", rs.get(m).getCustomerId());
               loginStatus = WebService.invokeLoginWS("sereen","razan","ma7moud","3","4","5","7","InsertCustomerInvoice");
            } catch(Exception e) {
                e.printStackTrace();
            }
         }

        return null;
    }
}

在我致电asynctask后,它没有到达asynctask onPostExecute(),我添加了trycatch并尝试调试但是我没有得到任何东西,谁能告诉我为什么?

0 个答案:

没有答案