当前位置: 首页>>代码示例>>Java>>正文


Java VKSdk.wakeUpSession方法代码示例

本文整理汇总了Java中com.vk.sdk.VKSdk.wakeUpSession方法的典型用法代码示例。如果您正苦于以下问题:Java VKSdk.wakeUpSession方法的具体用法?Java VKSdk.wakeUpSession怎么用?Java VKSdk.wakeUpSession使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.vk.sdk.VKSdk的用法示例。


在下文中一共展示了VKSdk.wakeUpSession方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: shareVK

import com.vk.sdk.VKSdk; //导入方法依赖的package包/类
private void shareVK() {
    if (VKSdk.isLoggedIn() || VKSdk.wakeUpSession()) {
        new VKShareDialog()
                .setText(getString(R.string.like_text))
                .setAttachmentLink(getString(R.string.like_url_title), getString(R.string.like_url))
                .setShareDialogListener(new VKShareDialog.VKShareDialogListener() {
                    @Override
                    public void onVkShareComplete(int i) {
                        showThankYouToast();

                        ((NavigationActivity)getActivity()).getTracker(NavigationActivity.TrackerName.APP_TRACKER)
                                .send(new HitBuilders.EventBuilder().setCategory("Sharing").setAction("VK").setLabel("OK").build());
                    }

                    @Override
                    public void onVkShareCancel() {
                        ((NavigationActivity)getActivity()).getTracker(NavigationActivity.TrackerName.APP_TRACKER)
                                .send(new HitBuilders.EventBuilder().setCategory("Sharing").setAction("VK").setLabel("Cancel").build());
                    }
                })
                .show(getFragmentManager(), "SHARE");

    } else
        VKSdk.authorize(NavigationActivity.vkScope, true, false);
}
 
开发者ID:dmllr,项目名称:IdealMedia,代码行数:26,代码来源:NavigationDrawerFragment.java

示例2: onCreate

import com.vk.sdk.VKSdk; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    VKUIHelper.onCreate(this);
    StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
    StrictMode.setThreadPolicy(policy);

    setContentView(R.layout.activity_main);
    app_bar = (Toolbar) findViewById(R.id.app_bar);
    setSupportActionBar(app_bar);
    getSupportActionBar().setDisplayShowHomeEnabled(true);
    drawerFragment = (NavigationDrawerFragment)
            getSupportFragmentManager().findFragmentById(R.id.fragment_navigation_drawer);
    drawerFragment.init((DrawerLayout) findViewById(R.id.drawer_layout), this, app_bar);
    // VK INITIALIZATION
    VKSdk.initialize(listener, Config.APP_ID, null);
    // VK Authorize User
    if(VKSdk.wakeUpSession() && user.authed()){

    }else{
        selectSection(-1);
    }
}
 
开发者ID:PhilipPavo,项目名称:VK-Files,代码行数:24,代码来源:MainActivity.java

示例3: onResume

import com.vk.sdk.VKSdk; //导入方法依赖的package包/类
@Override
public void onResume() {
    super.onResume();

    if (VKSdk.isLoggedIn() || VKSdk.wakeUpSession())
        update(isNeedUpdate());
    else
        VKSdk.authorize(NavigationActivity.vkScope, true, false);
}
 
开发者ID:dmllr,项目名称:IdealMedia,代码行数:10,代码来源:VKAudioFragment.java

示例4: call

import com.vk.sdk.VKSdk; //导入方法依赖的package包/类
@Override
public FREObject call( FREContext context, FREObject[] args ) {
	super.call( context, args );

	boolean enableLogs = FREObjectUtils.getBoolean( args[1] );
	AIR.setLogEnabled( enableLogs );
	VKSdk.DEBUG = enableLogs;
	int appId = Integer.valueOf( FREObjectUtils.getString( args[0] ) );

	AIR.log( "Initializing VKSdk" );

	Activity activity = AIR.getContext().getActivity();

	AIR.startAccessTokenTracker();
	VKSdk.customInitialize( activity, appId, "" );
	VKSdk.wakeUpSession( activity, new VKCallback<VKSdk.LoginState>() {
		@Override
		public void onResult( VKSdk.LoginState res ) {
			AIR.log( "VKSdk.wakeUpSession::onResult " + res );
			AIR.notifyTokenChange( VKAccessToken.currentToken() );
		}

		@Override
		public void onError( VKError error ) {
			AIR.log( "VKSdk.wakeUpSession::onError " + error.errorReason );
			AIR.notifyTokenChange( VKAccessToken.currentToken() );
		}
	} );

	return null;
}
 
开发者ID:marpies,项目名称:vk-ane,代码行数:32,代码来源:InitFunction.java

示例5: onCreate

import com.vk.sdk.VKSdk; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.activity_login);

    ActionBar actionBar = getActionBar();
    if(actionBar != null){
        actionBar.hide();
    }

    /*String[] fingerprints = VKUtil.getCertificateFingerprint(this, this.getPackageName());
    if(fingerprints != null){
        for(int i = 0; i < fingerprints.length; i++){
            Log.i(LOG_TAG, "fingerprints: " + fingerprints[i]);
        }
    }else {
        Log.i(LOG_TAG, "fingerprints is null");
    }*/

    VKSdk.wakeUpSession(this, new VKCallback<VKSdk.LoginState>() {
        @Override
        public void onResult(VKSdk.LoginState res) {
            Log.i(LOG_TAG, "VKSdk.LoginState: "  + res + ", isLoggedIn: " + VKSdk.isLoggedIn());

            switch (res) {
                case LoggedOut:
                    showLogin();
                    break;
                case LoggedIn:
                    loadUser("wakeUpSession LoggedIn");
                    break;
                case Pending:
                    break;
                case Unknown:
                    break;
            }
        }

        @Override
        public void onError(VKError error) {
            Log.e(LOG_TAG, "VKError: "  + error);
        }
    });
}
 
开发者ID:DmitriyG1,项目名称:vk-music-player-android,代码行数:46,代码来源:LoginActivity.java

示例6: onCreate

import com.vk.sdk.VKSdk; //导入方法依赖的package包/类
@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_start);
        VKSdk.wakeUpSession(this, new VKCallback<VKSdk.LoginState>() {
            @Override
            public void onResult(VKSdk.LoginState res) {
                if (isResumed) {
                    switch (res) {
                        case LoggedOut:
                            showLogin();
                            break;
                        case LoggedIn:
                            showLogout();
                            break;
                        case Pending:
                            break;
                        case Unknown:
                            break;
                    }
                }
            }

            @Override
            public void onError(VKError error) {

            }
        });

//        String[] fingerprint = VKUtil.getCertificateFingerprint(this, this.getPackageName());
//        Log.d("Fingerprint", fingerprint[0]);
    }
 
开发者ID:VKCOM,项目名称:vk-android-sdk,代码行数:33,代码来源:LoginActivity.java


注:本文中的com.vk.sdk.VKSdk.wakeUpSession方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。