I am displaying a toast outside of the Application.
I works fine like this with Toast:
Toast.makeText(getBaseContext(),"Text").show();
But when I try with Dialog i returns a
final Dialog dialog_edu = new Dialog(getBaseContext());
dialog_edu.setTitle("Choose Action");
dialog_edu.show();
it returns this:
01-28 18:02:04.734: W/WindowManager(329): Attempted to add window with non-application token WindowToken{41c01dd8 token=null}. Aborting.
01-28 18:02:04.734: E/AndroidRuntime(2626): FATAL EXCEPTION: main
01-28 18:02:04.734: E/AndroidRuntime(2626): android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application
If I use "MyAcitivity.this" for the context it works within the application, but not when i go out for the application. The Toast on the other hand works inside and outside of the application.
I have read, that you can use : getActivity() and others, but in the current state it returns the same error.
If I use a handler and try to delay the build of the dialog, it has no effect for a delay period of 1 full second.
So how do i get a Dialog to work inside and outside of the application.