Toast Notification From FileObserver Class
<p>I have an issue similar to <a href="http://stackoverflow.com/questions/5963438/toast-from-fileobserver">Toast from FileObserver</a>.  However, I do not understand how to properly implement the Handler.</p>

<p>Currently, I have a <code>FileObserver</code>-class and I am passing it context and a handler (context comes from <code>getApplicationContext()</code> from the service I call the <code>FileObserver</code>-class from). The handler I pass in (handle) is defined and created in the service. In the <code>onEvent()</code> of the <code>FileObserver</code>-class, I have:</p>

<pre><code>handle.post(new Runnable() {
    public void run() {
        CharSequence text = "Hello toast!";
        int duration = Toast.LENGTH_SHORT;

        Toast toast = Toast.makeText(context, text, duration);
        toast.show();
    }
});
</code></pre>

<p>But, I end up with a <code>java.lang.NullPointerException</code>.</p>

<p>How do I properly make the toast notification show up when I send it from the <code>onEvent()</code> of the <code>FileObserver</code>-class?</p>
