开发者

Android - Launch notification from anywhere?

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜