【发布时间】:2016-08-31 18:44:47
【问题描述】:
我有此代码可以登录以在我的应用中进行 spotify。我使用的是官方的 spotify 库。
public void spotifyLoginBtnClicked(View v){
//start the authentication for spotify
AuthenticationRequest.Builder builder = new AuthenticationRequest.Builder(clientID, AuthenticationResponse.Type.TOKEN, redirectURI);
builder.setScopes(new String[]{"user-read-private", "streaming"});
AuthenticationRequest request = builder.build();
// open LoginActivity
AuthenticationClient.openLoginActivity(this, activityIdentification, request);
}
我现在想知道如何创建注销按钮。因为一旦登录,如果我再次按下登录按钮,它就会返回。所以我无法更改用户。我没有在 java 文档中找到任何东西。
【问题讨论】:
-
你不知道怎么做onClick? google "android xml onClick" 你会找到它
-
我不知道如何为当前登录的 spotify 用户执行注销。按下按钮不是问题