本文整理匯總了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);
}