Is this Runnable safe from memory leak?

前端 未结 4 843
野的像风
野的像风 2021-01-18 05:58

I am a total beginner in Java and have created a simple Java Android snippet where in a Runnable after 1,5 seconds I change the TextView from Hello World<

4条回答
  •  萌比男神i
    2021-01-18 06:24

    h.postDelayed(new WeakRunnable(txtview),1500); I think it will be blocking UI Thread. here is a good sample for memory leak. https://github.com/badoo/android-weak-handler

提交回复
热议问题