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 d开发者_如何学JAVAon'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
...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.
加载中,请稍侯......
精彩评论