It seems like what you should really be doing is using a system
notification anyway, you don't want to randomly pop up a dialog box
(actually, you can probably pop up a toast in your case, which you can
do from the application context..), but a system bar notification
probably makes the most sense.

kris

On Thu, Feb 16, 2012 at 1:28 AM, Weston Weems <[email protected]> wrote:
> Treking
>
> Basically this is what I've done... say I have MyAppActivity which has
> stuff that automatically registers itself into application... events
> come in, application gets last accessed and I use that to start
> dialogs etc.
>
> Seemed like there were cases where it was throwing exceptions about
> null window token even though the activity reference itself wasnt
> null. Ie, just simply keeping a reference around doesnt guarentee its
> suitable to spawn dialogs (even if it IS an activity).
>
> I also tried to have in my base callback a context we pass through...
> could be activity or app context and thats fine... and say I want to
> spawn dialog if context is a subclass of Activity... seems like that
> works decent... but seems like that has potential to have problems if
> the activity goes away before the callback returns.
>
> I guess I am frustrated... I like in IOS dev I can just create a
> UIAlert, and show =)
>
> I know that there are things in place on purpose (for fluid user
> experience, but for a lot of the stuff I build, its much lower
> level... rom hacking and such and I do have a legitimate excuse to be
> wanting to do things the way I want)
>
> Weston
>
>
>
> On Feb 15, 4:12 pm, TreKing <[email protected]> wrote:
>> On Wed, Feb 15, 2012 at 5:49 PM, Weston Weems <[email protected]> wrote:
>> >  it doesnt even seem there is a decent way to
>> > test to see if context is
>> > 1) a valid ui context from which I can pop dialogs, show dialog fragments
>> > etc
>>
>> Don't use a base Context, use an Activity, which itself is a Context, but
>> one associated with UI (as opposed to, say, a Service).
>>
>> > 2) know if the reference to the instance of the activity or whatever
>> > actually has ties enough to spawn a dialog etc.
>>
>> That is not very clear.
>>
>> --------------------------------------------------------------------------- 
>> ----------------------
>> TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago
>> transit tracking app for Android-powered devices
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to