android - This Handler class should be static or are there leaks?? Whats' happening? -


i newbie android programmer , found out handle issue program, when try run below program forcefully closed.

why happening ?? how solve problem ?? thank you

public class antivirus extends activity {      protected static final int stop = 100;     private imageview iv;     private progressbar pb;     private linearlayout ll;     private animationdrawable anim;     private scrollview sv;     private sqlitedatabase db;     private boolean flagscanning = false;     private handler handler = new handler() {          @override         public void handlemessage(message msg) {             super.handlemessage(msg);              if(msg.what==stop){                  ll.removeallviews();                  anim.stop();                   }              string str = (string) msg.obj;              textview tv = new textview(getapplicationcontext());              tv.settext(str);              ll.setorientation(linearlayout.vertical);              ll.addview(tv);              sv.scrollby(0, 20);              system.out.println(str);          }      }; 


Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

html - Unable to style the color of bullets in a list -

c# - must be a non-abstract type with a public parameterless constructor in redis -