Possible Duplicate:
Android 1.6: "android.view.WindowManager$BadTokenException: Unable to add window — token null is not for an application"
I've tried different things, but I still keep the same error:
android.view.WindowManager$BadTokenException: Unable to add window 
At this line:
alertDialog.show();
Can you look at the code?
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle icicle) {
    super.onCreate(icicle);
    setContentView(R.layout.splashscreen);
    Context mContext = this;
    alertDialog = new AlertDialog.Builder(mContext).create();
    LoadData();
}
public void LoadData()
{
    Thread t1 = new Thread(this);
t1.start();
}
private Handler handler = new Handler()
{
@Override
    public void handleMessage(Message msg) 
    {            
        if(!rssItems.isEmpty())
        {
            switch (msg.what) {
            case STOPSPLASH:
                //remove SplashScreen from view
                //splash.setVisibility(View.GONE);
                Intent intent = new Intent(
                "news.displayNews");
                intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP);
                NewsDisplayer.rssItems.clear();
                NewsDisplayer.rssItems.addAll(rssItems);
                startActivity(intent);
                Close();
                break;
            }
        }
        else
        {
            alertDialog.setCancelable(false); // This blocks the 'BACK' button
            alertDialog.setMessage("No connection.");
            alertDialog.setTitle("Error...");
            alertDialog.setButton("Again", new DialogInterface.OnClickListener() {
                @Override
                public void onClick(DialogInterface dialog, int which) {
                    dialog.dismiss();     
                    LoadData();
                }
            });
            alertDialog.setButton2("Close", new DialogInterface.OnClickListener() {
                @Override
                public void onClick(DialogInterface dialog, int which) {
                    dialog.dismiss();     
                    System.exit(0);
                }
            });
            alertDialog.show();
        }
    }
 };
 
     
     
    