简体   繁体   中英

how to know whether service is running or not

I am starting my service through alarmManager.I want to show a dialog box as soon as service gets start.How can I do it? I mean how to know whether my service started or not.Is there any capability in alarmmanager to let me know when it triggers its event or something like that.

I want to show a dialog box as soon as service gets start.How can I do it?

Please don't. First, services cannot display a Dialog . Second, users really do not like random windows popping up in the middle of their doing other work, playing games, etc.

I mean how to know whether my service started or not.

Use LogCat and android.util.Log .

Is there any capability in alarmmanager to let me know when it triggers its event or something like that.

Use LogCat and android.util.Log in your Service (or, if applicable, in the BroadcastReceiver that starts the Service ).

您可以在服务启动时发送广播,并在其他地方接收以显示对话框。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM