Android 如何让通知经理工作?
当我打电话时Android 如何让通知经理工作?,android,Android,当我打电话时 NotificationManager mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); 我犯了一个错误 The method getSystemService(String) is undefined for the type new BroadcastReceiver(){}
NotificationManager mNotificationManager =
(NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
我犯了一个错误
The method getSystemService(String) is undefined for the type new BroadcastReceiver(){}
我不知道我在哪里搞砸了。。。
TIA像这样使用
NotificationManager mNotificationManager =
(NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
像
NotificationManager mNotificationManager =
(NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
据我所知,从BroadcastReceiver调用一些涉及上下文的方法是不安全的,如
Context.bindService()
据我所知,从BroadcastReceiver调用一些涉及上下文的方法是不安全的,如Context.bindService()所述
在broadcastReceiver中,您在哪里调用此语句?在broadcastReceiver中,您在哪里调用此语句?