How to show Dialog Box from the class which extends Application in android?
I want show a dialog box after specific condition , but for demo right now I want show a Dialog Box from the class which extends Application . here is my code public class ControlApplication extends Application { @Override { super.onCreate(); final Dialog dialog = new Dialog ( getApplicationContext() ); dialog.setTitle("zakasssssssssssssssssss"); dialog.setCancelable(false); dialog.show(); } } but at the dialog.show() I am getting error like Attempted to add window with non-application token WindowToken{4067a268 token=null}. Aborting. D/AndroidRuntime( 1923): Shutting down VM W/dalvikvm( 1923)