简体   繁体   English

Android Toast没有出现

[英]Android Toast doesn't show up

I am using a Samsung Galaxy Note 8 with Android 8.0. 我正在使用带有Android 8.0的三星Galaxy Note 8。

My Toast message (which was working) does not show up 我的Toast消息(工作正常)没有显示

Toast.makeText(this, "ABC", Toast.LENGTH_SHORT).show();

getApplicationContext() , getBaseContext() are not helping instead of this. getApplicationContext()getBaseContext()没有帮助而不是这个。 Using this in an activity . activity使用它。

Go to your app settings -> Notifications and check if notifications are turned on. 转到您的应用settings -> Notifications并检查通知是否已打开。 This action is possible in newer android versions 在较新的Android版本中可以执行此操作

Even though a Toast is not a notification, it seems that NotificationManagerService.java will not show Toast if Notifications are disabled. 即使Toast不是通知,如果禁用通知, NotificationManagerService.java似乎也不会显示Toast

I'm posting a link with the issue: https://issuetracker.google.com/issues/36951147 我发布了一个问题链接: https//issuetracker.google.com/issues/36951147

try with class name 尝试使用类名

Toast.makeText(ActivityName.this, "ABC", Toast.LENGTH_SHORT).show();

here ActivityName is your activity name 这里ActivityName是你的活动名称

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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