[英]android: cancel notification on back pressed
I want to cancel all notifications related to my app when the back button is clicked. 单击后退按钮时,我想取消与我的应用程序相关的所有通知。 I am not able to find a way. 我找不到办法。 Have you any idea? 你有什么主意吗
Hope it help 希望对你有帮助
@Override
public void onBackPressed() { 公共无效onBackPressed(){
// write code for canceling the notification
return;
} }
this may Helps you 这可能对您有帮助
@Override
public void onBackPressed() {
stopSelf();
return;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.