开发者

Android - Launch notification from anywhere?

开发者 https://www.devze.com 2023-01-08 06:40 出处:网络
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 backg

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

精彩评论

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