JavaScriptInterface not called
<p>Why my code below doesn't trigger my JavaScriptInterface : I can't see any dialogbox popup (I guess that android.widget.Toast is supposed to do) when webview loads.</p>

<pre><code>package com.example;

import android.app.Activity;
import android.os.Bundle;
import android.webkit.WebView;

public class MyActivity extends Activity
{
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        String data = "&lt;html&gt;" +
                "&lt;body&gt;&lt;h1&gt;Test JavaScriptInterface&lt;/h1&gt;&lt;/body&gt;" +
                "&lt;script&gt;Android.showToast(toast);&lt;/script&gt;" +
                "&lt;/html&gt;";

        WebView engine = (WebView) findViewById(R.id.web_engine);
        engine.getSettings().setJavaScriptEnabled(true);
        engine.addJavascriptInterface(new JavaScriptInterface(this), "Android");
        engine.loadData(data, "text/html", "UTF-8");

    }
}
</code></pre>

<p>package com.example;</p>

<pre><code>import android.content.Context;
import android.widget.Toast;

public class JavaScriptInterface {

    Context mContext;

    /** Instantiate the interface and set the context */
    JavaScriptInterface(Context c) {
        mContext = c;
    }

    /** Show a toast from the web page */
    public void showToast(String toast) {
        Toast.makeText(mContext, toast, Toast.LENGTH_SHORT).show();
    }

}
</code></pre>
