Passing context to Handler
Is it possible to pass arguments to an Android Handler?? I have two pieces of code. new Thread(){ public void run(){ for(;;){ uiCallback.sendEmptyMessage(0); Thread.sleep(2000); //sleep for 2 seconds } } }.start(); private Handler uiCallback = new Handler(){ public void handleMessage(Message msg){ //add a new blossom to the blossom ArrayList!! blossomArrayList.add(new Blossom(context, R.drawable.blossom)); } }; I of course get an error because the Handler method cannot see my context. This is probably because of this piece of code public BoardView(Context context){ super(context); Context is