@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_vklogin); VKUIHelper.onCreate(this); VKSdk.initialize(sdkListener, appID, VKAccessToken.tokenFromSharedPreferences(this, sTokenKey)); VKSdk.authorize(sMyScope, true, true); }
@Override protected void onResume() { super.onResume(); VKUIHelper.onResume(this); if (VKSdk.wakeUpSession()) { MyIntentService.startActionNewsfeedGetVKRequest( context, myApp.getPreferences().getVkToken(), myApp.getPreferences().getVKFeedStartFrom()); } else { VKSdk.authorize(sMyScope, true, true); } }
@Override public void onTokenExpired(VKAccessToken expiredToken) { VKSdk.authorize(sMyScope); }