private void openLoginWindow() { final AuthenticationRequest request = new AuthenticationRequest.Builder( CLIENT_ID, AuthenticationResponse.Type.TOKEN, REDIRECT_URI) .setScopes( new String[] { "user-read-private", "playlist-read", "playlist-read-private", "streaming" }) .build(); AuthenticationClient.openLoginActivity(this, REQUEST_CODE, request); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); AuthenticationRequest.Builder builder = new AuthenticationRequest.Builder( CLIENT_ID, AuthenticationResponse.Type.TOKEN, REDIRECT_URI); builder.setScopes(new String[] {"user-read-private", "streaming"}); AuthenticationRequest request = builder.build(); AuthenticationClient.openLoginActivity(this, REQUEST_CODE, request); findViewById(R.id.gotoAlarm) .setOnClickListener( new View.OnClickListener() { public void onClick(View v) { gotoAlarm(); } }); }