6

我使用了一些处理程序,例如

           new Handler(Looper.getMainLooper()).post(new Runnable() {

            @Override
            public void run() {
                try{
                    Messages.onAcknowledgeReceived();                                       

                }catch(Exception e){
                    e.printStackTrace();
                }

                }
            }); 

它每 15 秒执行一次,有时它开始抛出一些警告,例如

 The Looper class instance count has over a limit(100). There should be some leakage of Looper or HandlerThread.
 12-16 12:16:11.357: E/Looper(4647): Looper class instance count = 221
 12-16 12:16:11.357: E/Looper(4647): Current Thread Name: IntentService[AppService]
 12-16 12:16:12.316: E/Looper(4647): WARNING: The Looper class instance count has over a   limit(100). There should be some leakage of Looper or HandlerThread.
 12-16 12:16:12.318: E/Looper(4647): Looper class instance count = 222
 12-16 12:16:12.318: E/Looper(4647): Current Thread Name: IntentService[GCMIntentService-419284807656-203]

我的编程方法有什么问题吗?我仍然不明白这段代码的泄漏在哪里。

4

0 回答 0