expand the hit area of a view
<p>I have a small button on a view that I cannot make larger (movers and shakers don't want it larger).  It's very hard to click on the button because of other views around it.  At androiddevcon III Dave someone or another gave a talk on expanding the hit area of a view but he didn't include the code in his example.  Now I'm trying to figure out how to actually implement this.  </p>

<p>What i'm trying to do is fire a Button.onClick event if a click occurs within a larger rect.  The following code seems to work in the 2.3.4 emulator(hard to tell because the emulator doesn't have the functionality i'm trying to test) but doesn't at all on a Motorolla phone running android 2.3.4.</p>

<pre><code>    View view=findViewById(R.id.Header);
    view.setOnTouchListener(new OnTouchListener(){
    public boolean onTouch(View v, MotionEvent event) {
        Rect rect=new Rect();
        Button btn=(Button)findViewById(R.id.btn1);
        btn.getHitRect(rect);

        util.scaleRect(rect);
        if (rect.contains((int)event.getX(), (int)event.getY())){
            event.setLocation(rect.exactCenterX(), rect.exactCenterY());
            btn.dispatchTouchEvent(event);
            return true;
        }
        else{
           return false;
            }
    }
    });
</code></pre>
