Is it possible to do this using java on android?
<p>How can I include this code snippet within each activity without explicitly copy and pasting the code in each activity? For example can I just place it in one place and all other activities would Reference this piece of code?</p>

<pre><code>            @Override   
            public boolean dispatchTouchEvent(MotionEvent event) { 
                    // do something   

                    return super.dispatchTouchEvent(event);      

                }
</code></pre>
