如何在刷卡从将覆盖在Android中最近通话清单? [英] How to overide on swipe from recents list in Android?

查看:107
本文介绍了如何在刷卡从将覆盖在Android中最近通话清单?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直对Android应用程序,有一些基本的切换和驱动模式功能。在驱动方式,用户可以选择性地自动回复传入的通知,而这一切工作正常。我甚至在状态栏中永久通知时,启动拍摄模式。一个问题是,但是,当我的应用程序刷卡从Android上的最近通话菜单了,驱动模式为停止,但该通知仍然存在。所以我的问题是,无论我怎么能保持驱动模式运行,或者我怎么能删除通知。

I have been working on an Android app that has some basic toggles and a Drive Mode feature. In the Drive Mode, the user may optionally auto reply to incoming notifications and all this works fine. I even have a persistent notification in the status bar when Drive Mode is started. One problem is, however, when my app is swiped away from the recents menu in Android, Drive Mode is stopped but the notification is still there. So my question is, how can I either keep Drive Mode running, or how can I remove the notification.

我知道这可能是令人难以接受的,但不是在这里列出我的code,你可以在

I know this is probably frowned upon but instead of listing my code here, you may find it at

http://github.com/sociallymellow/mango

如果你想下载的APK(或见我的其他项目)的访问

and if you would like to download the apk (or see my other projects) visit

http://mellowdev.net

我试图使这个服务,但没有运气。我也试图@Override没有运气的方法的onDestroy。谢谢!

I have attempted to make this a service but no luck. I have also attempted to @Override the onDestroy method with no luck. Thanks!

推荐答案

我隐藏了我的应用程序从最近通话列表中加入 Android的整体解决我的问题:标签=@字符串/ APP_NAME到清单。我也加入了注释建议如下。

I have hidden my app from the recents list to overall fix my problem by adding android:label="@string/app_name" to the manifest. I have also added the following as suggested in a comment.

@Override
public void onDestroy() {
    NotificationManager nm = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);

    nm.cancelAll();
}

感谢大家的帮助和使用这两种完全一起解决我的问题。我希望这可以帮助其他人也!

Thank you all for the help and using both of these together completely solved my problem. I hope this helps others as well!

这篇关于如何在刷卡从将覆盖在Android中最近通话清单?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆