-
Notifications
You must be signed in to change notification settings - Fork 223
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FLAG_ACTIVITY_NEW_TASK #9
Comments
是startActivity()的报错,这是一个内部的Intent,只在钉钉内才能使用,所以要确保钉钉启动之后,再调用 attendKaoqin() |
如果要在任意活动界面,拉起钉钉的考勤界面,可以在intent中加一个flags数组参数 /**
* @description 使用 URL Scheme 进入考勤界面
*/
function attendKaoqin(){
var url_scheme = "dingtalk://dingtalkclient/page/link?url=https://attend.dingtalk.com/attend/index.html"
if(CORP_ID != "") {
url_scheme = url_scheme + "?corpId=" + CORP_ID
}
var a = app.intent({
action: "VIEW",
data: url_scheme,
flags: [Intent.FLAG_ACTIVITY_NEW_TASK]
});
app.startActivity(a);
console.info("正在进入考勤打卡页面...")
sleep(6000)
if (null != textMatches("申请").clickable(true).findOne(3000)) {
console.log("已进入考勤打卡页面")
sleep(1000)
}
} |
不好意思,没描述清楚。 我把脚本导入Autojs这个app,然后点击运行。就报这个错了。 |
通知监听依赖于通知服务,如果通知服务没有运行,会抛出异常并跳转到通知权限开启界面。(有时即使通知权限已经开启通知服务也没有运行,这时需要关闭权限再重新开启一次) |
看下设置里,AutoJs的通知权限,是“允许通知”吗? |
已经是设置的允许通知 |
额,我打不开图片。可以用文字描述是哪2个选项吗?我这边只打开‘无障碍服务’。 |
菜单里的 读取通知权限、前台服务 |
解决了,是这个问题。谢谢,麻烦了 |
多谢,跟我的问题一样,就是读取通知的权限. |
Wrapped android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?
我在运行事件监听的时候遇到这样一个错误,怎么处理?
The text was updated successfully, but these errors were encountered: