本文整理汇总了Java中com.weibo.net.Weibo.getInstance方法的典型用法代码示例。如果您正苦于以下问题:Java Weibo.getInstance方法的具体用法?Java Weibo.getInstance怎么用?Java Weibo.getInstance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.weibo.net.Weibo
的用法示例。
在下文中一共展示了Weibo.getInstance方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doInBackground
import com.weibo.net.Weibo; //导入方法依赖的package包/类
@Override
protected ApiResult doInBackground(String... uid) {
ApiResult u = null;
Map<String, Object> p = new HashMap<String, Object>();
p.put("email", uid[0]);
p.put("user_name", uid[1]);
p.put("password", uid[2]);
p.put("user_status", "2001");
p.put("user_id", userId);
if(weiboUser != null){
Weibo weibo = Weibo.getInstance();
p.put("profile_pic_url", weiboUser.getString("profile_image_url"));
p.put("ref_uid", weiboUser.getString("id"));
p.put("ref_token", weibo.getAccessToken().getToken());
p.put("ref_type", "sina");
}
u = client.registerUser(p);
return u;
}
示例2: SsoHandler
import com.weibo.net.Weibo; //导入方法依赖的package包/类
public SsoHandler(Activity activity, Handler handler) {
mAuthActivity = activity;
if(handler != null){
this.handler = handler;
}
mWeibo = Weibo.getInstance();
mWeibo.setupConsumerConfig(Constants.SINA_APPID, Constants.SINA_APPKEY);
mWeibo.setRedirectUrl(Constants.SINA_CALLBACK);
//Weibo.isWifi=Utility.isWifi(activity);
conn = new ServiceConnection() {
@Override
public void onServiceDisconnected(ComponentName name) {
/**
* 为啥在Disconnected的时候启动登陆窗口?
*/
//mWeibo.startAuthDialog(mAuthActivity, mAuthDialogListener);
}
@Override
public void onServiceConnected(ComponentName name, IBinder service) {
RemoteSSO remoteSSOservice = RemoteSSO.Stub.asInterface(service);
try {
ssoPackageName = remoteSSOservice.getPackageName();
ssoActivityName = remoteSSOservice.getActivityName();
boolean singleSignOnStarted = startSingleSignOn(
mAuthActivity, Constants.SINA_APPID, new String[]{},
mAuthActivityCode);
if (!singleSignOnStarted) {
startWebLogin();
}
} catch (RemoteException e) {
e.printStackTrace();
}
}
};
}
示例3: onCreate
import com.weibo.net.Weibo; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.share_to_weibo);
loading = new ProgressDialog(this);
loading.requestWindowFeature(Window.FEATURE_NO_TITLE);
loading.setMessage("登录中...");
Intent intent = this.getIntent();
picUrl = intent.getStringExtra("picUrl");
String text = intent.getStringExtra("text");
link = intent.getStringExtra("link");
message = (TextView)findViewById(R.id.share_text);
imageView = (ImageView)findViewById(R.id.taoke_pic);
Display display = null;
display = getWindowManager().getDefaultDisplay();
int disWidth = display.getWidth();
client.tmpImgLoader.loadImage(picUrl, imageView, disWidth, true); // .cache.get(picUrl, disWidth, true,true);
message.setText(text);
weibo = Weibo.getInstance();
weibo.setupConsumerConfig(Constants.SINA_APPID, Constants.SINA_APPKEY);
progress = (ProgressBar) findViewById(R.id.progressbar_loading);
progress.setVisibility(View.GONE);
if(weibo.getAccessToken() == null){
String accessToken = client.getSettings(Constants.PREFS_SINA_ACCESS_TOKEN);
String expires_in = client.getSettings(Constants.PREFS_SINA_EXPIRES_IN);
if(accessToken != null){
AccessToken token = new AccessToken(accessToken, Weibo.getAppSecret());
token.setExpiresIn(expires_in);
weibo.setAccessToken(token);
}
}
}
示例4: onResume
import com.weibo.net.Weibo; //导入方法依赖的package包/类
protected void onResume (){
super.onResume();
processBar.setVisibility(View.VISIBLE);
Weibo mWeibo = Weibo.getInstance();
mWeibo.setupConsumerConfig(Constants.SINA_APPID, Constants.SINA_APPKEY);
mWeibo.setRedirectUrl(Constants.SINA_CALLBACK);
sinaService = new WeiboLoginService(this, web, Weibo.getInstance(), loginListener, processBar);
sinaService.startLogin();
/*
new Thread(){
public void run(){
AppConfig cfg = client.config();
Weibo weibo = Weibo.getInstance();
String key = cfg.getString(AppConfig.SINA_APP_KEY);
String secret = cfg.getString(AppConfig.SINA_APP_SECRET);
String callback = cfg.getString(AppConfig.SINA_APP_CALLBACK);
if(key != null && key.length() > 0 && secret != null && secret.length() > 0){
weibo.setupConsumerConfig(key, secret);
weibo.setRedirectUrl(callback);
sinaService.startLogin();
}else {
Message msg = handler.obtainMessage(GetSinaUserInfoTask.LOGIN_MSG, "应用配置信息更新错误。");
}
}
}.start();
*/
}
示例5: initWeibo
import com.weibo.net.Weibo; //导入方法依赖的package包/类
/**
* 初始化weibo
*/
public static void initWeibo()
{
weibo = Weibo.getInstance();
weibo.setupConsumerConfig(CONSUMER_KEY, CONSUMER_SECRET);
weibo.setRedirectUrl(REDIRECT_URL);
}