本文整理汇总了Java中com.weibo.sdk.android.Weibo.getInstance方法的典型用法代码示例。如果您正苦于以下问题:Java Weibo.getInstance方法的具体用法?Java Weibo.getInstance怎么用?Java Weibo.getInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.weibo.sdk.android.Weibo
的用法示例。
在下文中一共展示了Weibo.getInstance方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import com.weibo.sdk.android.Weibo; //导入方法依赖的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);
}
示例2: onCreate
import com.weibo.sdk.android.Weibo; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
//若参数无效,则显示授权界面
requestWindowFeature(Window.FEATURE_NO_TITLE);
super.onCreate(savedInstanceState);
//创建微博对象
mWeibo = Weibo.getInstance(AppConfig.WEIBO_APP_KEY, AppConfig.WEIBO_REDIRECT_URL, AppConfig.WEIBO_SCOPE);
//读取保存参数
if(mApp.isWeiboAuthValid()) {
//若参数有效,则进入主界面
gotoMain();
} else {
setContentView(R.layout.activity_login);
//设置字体
TextView tv = (TextView)findViewById(R.id.text_login_title);
//从assert中获取有资源,获得app的assert,采用getAserts(),通过给出在assert/下面的相对路径。在实际使用中,字体库可能存在于SD卡上,可以采用createFromFile()来替代createFromAsset。
Typeface face = Typeface.createFromAsset(getAssets(), "fonts/Structr_Regular.ttf");
tv.setTypeface(face);
//设置界面元素
findViewById(R.id.weibo_login).setOnClickListener(this);
}
}
示例3: initWeibo
import com.weibo.sdk.android.Weibo; //导入方法依赖的package包/类
/**
* 初始化weibo
*/
public void initWeibo(){
weibo = Weibo.getInstance(CONSUMER_KEY, REDIRECT_URL);
}
示例4: RLWeiboHelper
import com.weibo.sdk.android.Weibo; //导入方法依赖的package包/类
private RLWeiboHelper(Context context) {
if (weibo == null) {
String key = context.getString(R.string.weibo_key);
weibo = Weibo.getInstance(key, REDIRECT_URL + key);
}
}