Is possible to raise an AlertDialog from a background thread using a reference to getApplicationContext()?

I'm trying with that code but it doesn't work

```
    new Thread(){
        public void run(){
            new AlertDialog.Builder(appcontext)
            .setMessage("Test")
            .setPositiveButton("Ok", null)
            .show();
        }
    }.start();

```

Thanks in advance