java android编舞:跳过271帧

时间:2017-03-22 12:03:38

标签: java android

当我点击一个按钮时,我的应用程序是冻结的,并且在我看到的是:

03-22 13:01:33.490 25636-26150/com.smok.maps D/dalvikvm: GC_FOR_ALLOC freed 2468K, 11% free 29508K/32996K, paused 65ms, total 65ms
03-22 13:01:36.914 25636-26150/com.smok.maps D/dalvikvm: GC_FOR_ALLOC freed 3957K, 17% free 28675K/34324K, paused 54ms, total 54ms
03-22 13:01:37.744 25636-25636/com.smok.maps I/Choreographer: Skipped 271 frames!  The application may be doing too much work on its main thread.
03-22 13:01:39.907 25636-26150/com.smok.maps D/dalvikvm: GC_FOR_ALLOC freed 3903K, 19% free 27910K/34324K, paused 42ms, total 42ms

这是我的行动:

 btUnselectAll.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                getActivity().runOnUiThread(new Runnable() {
                    @Override
                    public void run() {
//                        for (RowBean aRowBean_data : rowBeen) {
//                            aRowBean_data.setSelected(false);
//                        }
                        for (RowBean rowBean : Adapter.data) {
                            rowBean.setSelected(false);
                        }
                        adapter.notifyDataSetChanged();

                        for (ObjectDefExtends objectDefExtends : Singleton.getInstance().getListaODE()) {
                            objectDefExtends.visible = false;
                            editor.putInt(objectDefExtends.id.toString(), 0);
                            editor.apply();
                        }
                    }
                });

0 个答案:

没有答案