views:

74

answers:

1

Hi y'all!

I'm coding on the android right now, and I have an Activity which starts and stops a Service. However, related to this whole application will be a non-android java application which runs in the background alongside this app. I need this separate activity to be able to launch a notification, but I don't know how to do this. I cannot create a static method in either my Activity or my Service since then I wouldn't be able to get the context. Is there a way to do this?

Thanks! NS

+1  A: 

...a non-android java application which runs in the background alongside this app

Ummm...there is no real support in Android for "a non-android java application".

I need this separate activity to be able to launch a notification, but I don't know how to do this.

If it is an Activity, just use NotificationManager -- Activity is a Context.

If it is "a non-android java application", rewrite it such that it is an Activity or Service.

CommonsWare
Thanks! Sadly, that's not the answer I was hoping for since I was hoping for more of a "this magical class does it for you" kind of answer, but you're right.
Nathan Sabruka