How to make a deletion(or any action) textview timer?

You need to uninstall the item 10 seconds after its creation.
Timer timer = new Timer();
myLayout.addView(textView);
 timer.schedule(myLayout.removeView(textView),0,2000); //here is the Studio gives you need void there insert
June 14th 19 at 20:49
1 answer
June 14th 19 at 20:51
Solution
Handler.postDelayed(java.lang.Runnable, long)
View.postDelayed(java.lang.Runnable, long)

don't forget to call removeCallbacks(Runnable action). That memory is not leaking.

Find more questions by tags AndroidJava