相关疑难解决方法(0)

在Android 8.1 API 27上,通知不会显示

我在Android 8.1 API 27上获得了Toast:

包"my_package_name"的开发者警告
无法在...上发布通知

Logcat包含下一个字符串:

通知:对于卷控制以外的操作,不推荐使用流类型

W/Notification:请参阅setSound()的文档,了解如何使用android.media.AudioAttributes来限定播放用例

E/NotificationService:找不到pkg = my_package_name的频道

Toast和Logcat中的完整信息可以帮助解决此问题.

notifications android android-notifications android-8.0-oreo

31
推荐指数
3
解决办法
4万
查看次数

推送通知在 android studio 中不起作用

嗨,我需要添加推送通知以代表公司欢迎用户这里是我的代码,但它不起作用

 NotificationManager notif=(NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE);
      Notification notify=new Notification.Builder
  (getApplicationContext()).setContentTitle("BergEsapes").setContentText("Kindly Login Your Account").
                            setContentTitle("User Register Succesfully").setSmallIcon(R.drawable.appicon).build();

                    notify.flags |= Notification.FLAG_AUTO_CANCEL;
                    notif.notify(0, notify);
Run Code Online (Sandbox Code Playgroud)

java android push-notification android-notifications android-studio

3
推荐指数
1
解决办法
2912
查看次数