无法使用活动暂停超时查看布局

时间:2015-08-26 06:25:20

标签: android android-layout android-asynctask

我已经运行了我的活动 - > on create(with setContentView layout) - >运行asyncTask(在asynctask:请求数据库中使用php和SQL->获取响应 - >使用SQL结果设置textView)
我使用Log.e来跟踪进度,在asyncTask结束但模拟器没有将其视图更改为布局之前,类中没有错误

我的logcat:

08-26 06:29:49.644    1232-1289/? W/AudioTrack﹕ AUDIO_OUTPUT_FLAG_FAST denied by client
08-26 06:29:49.859    1232-1522/? V/WindowManager﹕ Adding window Window{390da99d u0 com.primo.blindpig_managerv1/com.primo.blindpig_managerv1.order} at 3 of 8 (after Window{3730a638 u0 com.primo.blindpig_managerv1/com.primo.blindpig_managerv1.index})
08-26 06:29:49.868    1232-2073/? V/WindowManager﹕ Adding window Window{1d919e3 u0 com.primo.blindpig_managerv1/com.primo.blindpig_managerv1.order} at 3 of 9 (before Window{390da99d u0 com.primo.blindpig_managerv1/com.primo.blindpig_managerv1.order})
08-26 06:29:49.959    2572-2589/? W/EGL_emulation﹕ eglSurfaceAttrib not implemented
08-26 06:29:49.959    2572-2589/? W/OpenGLRenderer﹕ Failed to set EGL_SWAP_BEHAVIOR on surface 0xa4811340, error=EGL_SUCCESS
08-26 06:29:50.113    2572-2595/? V/Checking data﹕ {"orders":[{"invoice_number":"5","order_number":"150825214234","customer_id":"39","applecider":"580","blackcurrant":"0","mankahoney":"0","kiwifruit":"0","pearlemon":"0","order_at":"2015-08-26 05:42:51","amount":"174000","remark":"","userstatus":"outlet","name":"tgv","phone":"588","email":"fcd@dd.cc","status":0}],"success":1}
08-26 06:29:50.113    2572-2595/? D/Create Response﹕ {"orders":[{"invoice_number":"5","order_number":"150825214234","customer_id":"39","applecider":"580","blackcurrant":"0","mankahoney":"0","kiwifruit":"0","pearlemon":"0","order_at":"2015-08-26 05:42:51","amount":"174000","remark":"","userstatus":"outlet","name":"tgv","phone":"588","email":"fcd@dd.cc","status":0}],"success":1}
08-26 06:29:50.123    2572-2589/? W/EGL_emulation﹕ eglSurfaceAttrib not implemented
08-26 06:29:50.123    2572-2589/? W/OpenGLRenderer﹕ Failed to set EGL_SWAP_BEHAVIOR on surface 0xa4812800, error=EGL_SUCCESS
08-26 06:29:50.672    1232-1250/? W/ActivityManager﹕ Activity pause timeout for ActivityRecord{245be861 u0 com.primo.blindpig_managerv1/.order t11 f}
08-26 06:29:55.187    2572-2572/? I/Choreographer﹕ Skipped 318 frames!  The application may be doing too much work on its main thread.
08-26 06:29:55.598    1232-1472/? W/InputMethodManagerService﹕ Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@36709a0c attribute=null, token = android.os.BinderProxy@19b6a29b

是否有任何可能的原因导致错误? 我的活动有很多变量findbyid到setText,是否会导致错误?

    class callcustomerorder extends AsyncTask<String, String, String> {

    @Override
    protected void onPreExecute() {
        super.onPreExecute();
    }

    protected String doInBackground(String... args) {


        String count = countingPage.toString();


        List<NameValuePair> params = new ArrayList<NameValuePair>();
        params.add(new BasicNameValuePair("count", count));

        JSONObject json = jsonParser.makeHttpRequest(url_get_customer_order,
                "POST", params);

        Log.d("Create Response", json.toString());

        try {
            int success = json.getInt(TAG_SUCCESS);
            if (success == 1) {
                orders = json.getJSONArray(TAG_ORDERS);

                    invoice_numebr = c.getString("invoice_number"); 
                }

                // closing this screen
               finish();  <<<<< here  cause the activity shut down
            } else if (success == 0) {
                Toast.makeText(getApplicationContext(), "Fail to connect next order", Toast.LENGTH_LONG).show();
            }
        } catch (JSONException e) {
            e.printStackTrace();
        }
        return null;
    }

private void settingStatusTextView() {
    switch (intstatus) {
        case 0:
            status.setText("A");
            break;
        case 1:
            status.setText("B");
            break;
        case 2:
            status.setText("C");
            break;
        case 3:
            status.setText("D");
            break;
    }
}

我想是的......因为它真的很长......设置TextView ..

0 个答案:

没有答案