Is there a difference between Dialog.getContext() and the Activity that made the dialog?

I suspect the problem with starting Dialog 2 from Activity 1 when Dialog 1 is visible is because Dialog 1 (not Activity 1) is on the top of the activity stack. I'm by no means an expert, but I suspect that only the Activity at the top of the Activity stack can start new Activities.

Well, it's a View, not an Activity, but I suspect it is something along the lines you describe, yes. – Andrew Wyld Oct 18 at 10:19 1 Actually to be technically correct a Dialog is neither a View or a Activity. They are a direct subclass of java.lang.

Object – slayton Oct 18 at 13:30 I stand corrected :) – Andrew Wyld Oct 18 at 14:35.

I'm not entirely certain if the contexts are different (it would appear they are), but I suspect the problem is that you are not dismissing Dialog1 before attempting to start Dialog2 from your Activity. The WindowManager is probably angry because you are attempting to start a dialog on top of your Activity, but Dialog1 is already there. Long story short, I think you need: public void onSomeOtherCondition() { this.dismiss(); mActivity.

OnSomeOtherCondition(); //we have a reference to the activity } EDIT The solution I proposed in the comments is to pass Dialog1's context to mActivity. OnSomeOtherCondition so that you can create Dialog2 with the context that is at the top of the stack.

Almost certainly, but it has allowed us to open a second dialog from WITHIN a first dialog previously (as in the example: we make the Dialog2 from inside the Dialog1: no problems). We'd rather keep the original one open if we can as it makes more sense for the user in this case (the secondary one is a "loading ... " type dialog). This is why I'm interested in the context and what it does!

Thanks though :) – Andrew Wyld Oct 17 at 15:42 I suppose we COULD keep a stack of Dialog objects in the Activity and make sure we getContext() from the top one ...? – Andrew Wyld Oct 17 at 15:44 1 You could just pass the context into onSomeOtherCondition to create the Dialog with as well. That's probably easier. – Justin Breitfeller Oct 17 at 15:45 Yeah, I think that's what we're going to have to do.

Thanks! – Andrew Wyld Oct 170 at 10:19.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions