• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java SsoHandler类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.weibo.sdk.android.sso.SsoHandler的典型用法代码示例。如果您正苦于以下问题:Java SsoHandler类的具体用法?Java SsoHandler怎么用?Java SsoHandler使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



SsoHandler类属于com.weibo.sdk.android.sso包,在下文中一共展示了SsoHandler类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: handleMessage

import com.weibo.sdk.android.sso.SsoHandler; //导入依赖的package包/类
public void handleMessage(final Message msg) {
	Log.d("emop", "message id:" + msg.what +", msg:" + msg.obj);
	String message = null;
	if(msg.obj != null){
		message = msg.obj.toString();
		if(message != null){
			Toast.makeText(SettingActivity.this, message, Toast.LENGTH_LONG).show();
		}
	}
	if(msg.what == GetSinaUserInfoTask.LOGIN_DONE){
		loading.dismiss();
		showSinaInfo();
	}else if(msg.what == SsoHandler.START_WEB_LOGIN || msg.what == SsoHandler.SSO_LOGIN_ERROR){
		loading.dismiss();
	}
}
 
开发者ID:emop,项目名称:EmopAndroid,代码行数:17,代码来源:SettingActivity.java


示例2: onClick

import com.weibo.sdk.android.sso.SsoHandler; //导入依赖的package包/类
@Override
public void onClick(View v) {
    int id = v.getId();
    
    switch(id) {
        case R.id.weibo_login: {
            mSsoHandler = new SsoHandler(this, mWeibo);
            mSsoHandler.authorize(new AuthDialogListener(),null);
            break;
        }
        
        default: {
            KLog.w(TAG, "Unknow id onClick : %d", id);
            break;
        }
    }
}
 
开发者ID:alexcaisenchuan,项目名称:FunWeibo,代码行数:18,代码来源:ActivityLogin.java


示例3: onResume

import com.weibo.sdk.android.sso.SsoHandler; //导入依赖的package包/类
public void onResume(){
	super.onResume();
	if(loginTimes < 3 && weibo.getAccessToken() == null && !loading.isShowing()){
		loginTimes++;
    	sinaSSO = new SsoHandler(this, sinaHandler);
    	loading.show();
    	sinaSSO.authorize();			
	}
}
 
开发者ID:emop,项目名称:EmopAndroid,代码行数:10,代码来源:ShareToWeiboActivity.java


示例4: handleMessage

import com.weibo.sdk.android.sso.SsoHandler; //导入依赖的package包/类
public void handleMessage(final Message msg) {
	Log.d("emop", "message id:" + msg.what +", msg:" + msg.obj);
	String message = null;
	if(msg.obj != null){
		message = msg.obj.toString();
		if(message != null){
			Toast.makeText(ShareToWeiboActivity.this, message, Toast.LENGTH_LONG).show();
		}
	}
	if(msg.what == GetSinaUserInfoTask.LOGIN_DONE){
		loading.dismiss();    			
	}else if(msg.what == SsoHandler.START_WEB_LOGIN || msg.what == SsoHandler.SSO_LOGIN_ERROR){
		loading.dismiss();
	}
}
 
开发者ID:emop,项目名称:EmopAndroid,代码行数:16,代码来源:ShareToWeiboActivity.java


示例5: doLoginFromSina

import com.weibo.sdk.android.sso.SsoHandler; //导入依赖的package包/类
public void doLoginFromSina(View v){
	Log.d("tag", "doLoginFrom sina");
	if(this.isLoginSina){
		logoutRef(Constants.AUTH_REF_SINA);
		Weibo.getInstance().setAccessToken(null);
	}else {
    	sinaSSO = new SsoHandler(this, sinaHandler);
    	loading.show();
    	sinaSSO.authorize();
	}
}
 
开发者ID:emop,项目名称:EmopAndroid,代码行数:12,代码来源:SettingActivity.java


示例6: doLoginFromSina

import com.weibo.sdk.android.sso.SsoHandler; //导入依赖的package包/类
public void doLoginFromSina(View v){
  	Log.d("tag", "doLoginFromsina");
  	/*
Intent intent = new Intent();			
intent.setClass(this, WebLoginActivity.class);
startActivity(intent);
*/    	
  	sinaSSO = new SsoHandler(this, handler);
  	loading.show();
  	sinaSSO.authorize();
  }
 
开发者ID:emop,项目名称:EmopAndroid,代码行数:12,代码来源:LoginActivity.java


示例7: handleMessage

import com.weibo.sdk.android.sso.SsoHandler; //导入依赖的package包/类
public void handleMessage(final Message msg) {
	String message = null;
	if(msg.obj != null){
		message = msg.obj.toString();
		if(message != null){
			Toast.makeText(LoginActivity.this, message, Toast.LENGTH_LONG).show();
		}
	}
	if(msg.what == GetSinaUserInfoTask.LOGIN_DONE){
		finish();
	}else if(msg.what == SsoHandler.START_WEB_LOGIN || msg.what == SsoHandler.SSO_LOGIN_ERROR){
		loading.dismiss();
	}
}
 
开发者ID:emop,项目名称:EmopAndroid,代码行数:15,代码来源:LoginActivity.java


示例8: onCreate

import com.weibo.sdk.android.sso.SsoHandler; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	setContentView(R.layout.timeline_activity);

	shared = this.getSharedPreferences("user_info", 0);
	editor = shared.edit();

	mWeibo = Weibo.getInstance(AppConst.SINA_KEY,
			"http://open.weibo.com/apps/" + AppConst.SINA_KEY
					+ "/info/advanced", SCOPE);
	IWeiboAPI weiboAPI = WeiboSDK.createWeiboAPI(this, AppConst.SINA_KEY);

	mSsoHandler = new SsoHandler(this, mWeibo);
	String pkName = this.getPackageName();
	mSsoHandler.authorize(new AuthDialogListener(), pkName);

	dataModel = new TimelineModel(this);
	dataModel.addResponseListener(this);

	feedListView = (XListView) findViewById(R.id.feed_list);
	feedListView.setPullLoadEnable(true);
	feedListView.setRefreshTime();
	feedListView.setXListViewListener(this, 1);

	listAdapter = new TimelineAdapter(this, dataModel.searchResult);
	feedListView.setAdapter(listAdapter);

	Drawable drawable = ResourcesFactory.getDrawable(getResources(),
			R.drawable.splash_background);
	ImageView header = (ImageView) findViewById(R.id.listImage);
	header.setImageDrawable(drawable);
	header.setBackgroundColor(Color.RED);

}
 
开发者ID:steven2947,项目名称:NeXT_pyp,代码行数:36,代码来源:TimelineActivity.java


示例9: auth

import com.weibo.sdk.android.sso.SsoHandler; //导入依赖的package包/类
/**
 * @param activity
 * @param handler
 * @return
 */
public SsoHandler auth(final Activity activity, final ReqHandler handler) {
    SsoHandler ssoHandler = new SsoHandler(activity, weibo);
    ssoHandler.authorize(new WeiboAuthListener() {
        @Override
        public void onComplete(Bundle data) {
            AccessTokenKeeper.clear(activity);
            Oauth2AccessToken token = new Oauth2AccessToken(data.getString("access_token"),
                    data.getString("expires_in"));
            AccessTokenKeeper.keepAccessToken(activity, token);
            handler.onSucceed();
        }

        @Override
        public void onCancel() {
            handler.onFail(activity.getString(R.string.weibo_auth_cancel));
        }

        @Override
        public void onError(WeiboDialogError error) {
            handler.onFail(error.getMessage());
        }

        @Override
        public void onWeiboException(WeiboException exception) {
            handler.onFail(exception.getMessage());
        }
    });
    return ssoHandler;
}
 
开发者ID:RincLiu,项目名称:Roid-Library,代码行数:35,代码来源:RLWeiboHelper.java


示例10: getSsoHandler

import com.weibo.sdk.android.sso.SsoHandler; //导入依赖的package包/类
public SsoHandler getSsoHandler() {
	return mSsoHandler;
}
 
开发者ID:phoenixNirvana,项目名称:NewCommunication-Android,代码行数:4,代码来源:SinaWeiboHelper.java


示例11: initSsoHandler

import com.weibo.sdk.android.sso.SsoHandler; //导入依赖的package包/类
private void initSsoHandler(Activity context){
	mSsoHandler = new SsoHandler(context, weibo);
}
 
开发者ID:phoenixNirvana,项目名称:NewCommunication-Android,代码行数:4,代码来源:SinaWeiboHelper.java


示例12: onActivityResult

import com.weibo.sdk.android.sso.SsoHandler; //导入依赖的package包/类
/**
 * @param handler
 * @param requestCode
 * @param resultCode
 * @param data
 */
public void onActivityResult(SsoHandler handler, int requestCode, int resultCode, Intent data) {
    if (handler != null) {
        handler.authorizeCallBack(requestCode, resultCode, data);
    }
}
 
开发者ID:RincLiu,项目名称:Roid-Library,代码行数:12,代码来源:RLWeiboHelper.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java TranscodeException类代码示例发布时间:2022-05-22
下一篇:
Java FsDatasetCache类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap