I created a PreferenceActivity with a Custom Title. In the title I added a button. In the button click event I added:
imageClearCache.setOnClickListener(new OnClickListener() {
              public void onClick(View v) { 
....
    new AlertDialog.Builder(getApplicationContext())
                      .setTitle("Alert!!")
                      .setMessage("Text...")
                      .setPositiveButton("Ok", new DialogInterface.OnClickListener() {
                            public void onClick(DialogInterface dialog, int which) { 
                                // continue with delete
                            }
                         }).show();
    }
I get the error: ...Unable to add window -- token null is not for an application
Any idea?
Best regards
 
    