Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/email/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android youtube自定义订阅按钮_Android_Android Studio_Youtube_Google Signin - Fatal编程技术网

Android youtube自定义订阅按钮

Android youtube自定义订阅按钮,android,android-studio,youtube,google-signin,Android,Android Studio,Youtube,Google Signin,我制作了一个android应用程序,用户可以在其中看到YouTube频道,并可以订阅特定频道。当用户在我的应用程序中打开视频时,会有一个用于订阅的自定义按钮。 我已经完成了身份验证部分,就像第一个用户必须登录谷歌才能使用我的应用程序一样,它正在成功运行。 经过研究,我找到了订阅按钮的代码 List<String> scopes = Lists.newArrayList("https://www.googleapis.com/auth/youtube"); try {

我制作了一个android应用程序,用户可以在其中看到YouTube频道,并可以订阅特定频道。当用户在我的应用程序中打开视频时,会有一个用于订阅的自定义按钮。 我已经完成了身份验证部分,就像第一个用户必须登录谷歌才能使用我的应用程序一样,它正在成功运行。 经过研究,我找到了订阅按钮的代码

List<String> scopes = Lists.newArrayList("https://www.googleapis.com/auth/youtube");

    try {
        // Authorize the request.
        Credential credential = Auth.authorize(scopes, "addsubscription");

        // This object is used to make YouTube Data API requests.
        youtube = new YouTube.Builder(Auth.HTTP_TRANSPORT, Auth.JSON_FACTORY, credential).setApplicationName(
                "youtube-cmdline-addsubscription-sample").build();
List scopes=Lists.newArrayList(“https://www.googleapis.com/auth/youtube");
试一试{
//批准请求。
凭证=授权(作用域,“添加订阅”);
//此对象用于发出YouTube数据API请求。
youtube=new youtube.Builder(Auth.HTTP_传输、Auth.JSON_工厂、凭证)。setApplicationName(
“youtube cmdline addsubscription示例”).build();
它正在显示无法解析的方法 'authorize.(java.util.List,java.lang.String)' 任何建议都会很有帮助。提前谢谢