gpt4 book ai didi

android - 如何让通知管理器工作?

转载 作者:行者123 更新时间:2023-11-29 16:03:08 27 4
gpt4 key购买 nike

当我打电话

NotificationManager mNotificationManager =
(NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);

我得到一个错误

The method getSystemService(String) is undefined for the type new BroadcastReceiver(){}

我不知道我哪里搞砸了...时间差

最佳答案

像这样使用

NotificationManager mNotificationManager =
(NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);

关于android - 如何让通知管理器工作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22006420/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com