I am newbie android programmer and I found out handle issue with this program, when i try to run the below program it is forcefully closed.
Why is this happening ?? How to solve this 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);
}
};