Android and Java: Reduce memory usage on a service loop

前端 未结 2 1532
猫巷女王i
猫巷女王i 2021-01-16 08:41

I have an Android Service which updates a notification every second using this Thread (comments are not really relevant):

thread = new Thread() {
    @Overri         


        
2条回答
  •  被撕碎了的回忆
    2021-01-16 08:46

    In finally block you can do the following thing

     finally {
    try {
        freeOut.close();
    } catch (IOException e) {
        e.printStackTrace();
    }
    

提交回复
热议问题