简体   繁体   English

Android电视通知访问

[英]Android tv notification Access

Me & another member of the Android TV dev community on Google+ were working on a project and it requires access to the notification access. 我和Google+上的Android TV开发社区的其他成员正在开展一个项目,它需要访问通知访问权限。 ex:the permission pushbullet asks for so it can mirror your phone notifications. 例如:权限pushbullet请求,以便它可以镜像您的手机通知。 And when trying to execute it it pushes me back to the open app screen and does nothing. 在尝试执行它时,它会将我推回打开的应用程序屏幕并且什么都不做。 Anyone's help would be great! 任何人的帮助都会很棒! Thanks! 谢谢! Here's the project if it helps-- https://github.com/Fleker/AndroidTVNotification 这是项目,如果有帮助 - https://github.com/Fleker/AndroidTVNotification

Anthony 安东尼

Following exception appeared when I execute your app, 我执行你的应用时出现以下异常,

09-08 22:24:15.380: E/AndroidRuntime(24570): Caused by: android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS } 09-08 22:24:15.380:E / AndroidRuntime(24570):引起:android.content.ActivityNotFoundException:找不到处理Intent的Activity {act = android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS}

Inside MainActivity.java, how do you want to handle the intent? 在MainActivity.java中,您想如何处理意图?

    public void buttonClicked(View v){

        ...

        case R.id.btnSettings:
            i =new Intent("android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS");
            startActivity(i);

    }
}

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

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