本文整理汇总了Java中com.twitter.sdk.android.core.TwitterCore.getInstance方法的典型用法代码示例。如果您正苦于以下问题:Java TwitterCore.getInstance方法的具体用法?Java TwitterCore.getInstance怎么用?Java TwitterCore.getInstance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.twitter.sdk.android.core.TwitterCore
的用法示例。
在下文中一共展示了TwitterCore.getInstance方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import com.twitter.sdk.android.core.TwitterCore; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.tw__activity_oauth);
spinner = findViewById(R.id.tw__spinner);
webView = findViewById(R.id.tw__web_view);
final boolean showProgress;
if (savedInstanceState != null) {
showProgress = savedInstanceState.getBoolean(STATE_PROGRESS, false);
} else {
showProgress = true;
}
spinner.setVisibility(showProgress ? View.VISIBLE : View.GONE);
final TwitterCore kit = TwitterCore.getInstance();
oAuthController = new OAuthController(spinner, webView,
getIntent().getParcelableExtra(EXTRA_AUTH_CONFIG),
new OAuth1aService(kit, new TwitterApi()), this);
oAuthController.startAuth();
}
示例2: createApiClientManager
import com.twitter.sdk.android.core.TwitterCore; //导入方法依赖的package包/类
private synchronized void createApiClientManager(){
if (apiClientManager == null) {
apiClientManager = new DigitsApiClientManager(TwitterCore.getInstance(),
getExecutorService(), getSessionManager(), null,
new DigitsRequestInterceptor(DigitsUserAgent.create()),
getSandboxConfig());
}
}
示例3: TweetUi
import com.twitter.sdk.android.core.TwitterCore; //导入方法依赖的package包/类
TweetUi() {
final TwitterCore twitterCore = TwitterCore.getInstance();
context = Twitter.getInstance().getContext(getIdentifier());
sessionManager = twitterCore.getSessionManager();
guestSessionProvider = twitterCore.getGuestSessionProvider();
tweetRepository = new TweetRepository(new Handler(Looper.getMainLooper()),
twitterCore.getSessionManager());
imageLoader = Picasso.with(Twitter.getInstance().getContext(getIdentifier()));
setUpScribeClient();
}
示例4: checkTwitterCoreAndEnable
import com.twitter.sdk.android.core.TwitterCore; //导入方法依赖的package包/类
private void checkTwitterCoreAndEnable() {
//Default (Enabled) in edit mode
if (isInEditMode()) return;
try {
TwitterCore.getInstance();
} catch (IllegalStateException ex) {
//Disable if TwitterCore hasn't started
Twitter.getLogger().e(TAG, ex.getMessage());
setEnabled(false);
}
}
示例5: initTwitterSearch
import com.twitter.sdk.android.core.TwitterCore; //导入方法依赖的package包/类
private void initTwitterSearch() {
core = TwitterCore.getInstance();
session = core.getSessionManager().getActiveSession();
if (session != null) {
client = core.getApiClient(session);
}
else {
client = core.getGuestApiClient();
}
if (client != null) {
doSearch();
}
}
示例6: DigitsGuestSessionProvider
import com.twitter.sdk.android.core.TwitterCore; //导入方法依赖的package包/类
DigitsGuestSessionProvider(SessionManager<DigitsSession> defaultSessionManager,
List<SessionManager<? extends Session>> sessionManagers) {
this(defaultSessionManager, sessionManagers,
new OAuth2Service(TwitterCore.getInstance(),
TwitterCore.getInstance().getSSLSocketFactory(), new DigitsApi()));
}
示例7: TweetRepository
import com.twitter.sdk.android.core.TwitterCore; //导入方法依赖的package包/类
TweetRepository(Handler mainHandler, SessionManager<TwitterSession> userSessionManagers) {
this(mainHandler, userSessionManagers, TwitterCore.getInstance());
}
示例8: Builder
import com.twitter.sdk.android.core.TwitterCore; //导入方法依赖的package包/类
/**
* Constructs a Builder.
*/
public Builder() {
twitterCore = TwitterCore.getInstance();
}
示例9: TwitterAuthClient
import com.twitter.sdk.android.core.TwitterCore; //导入方法依赖的package包/类
/**
* Constructor.
*
* @throws java.lang.IllegalStateException if called before starting TwitterKit with
* Twitter.initialize()
*/
public TwitterAuthClient() {
this(TwitterCore.getInstance(), TwitterCore.getInstance().getAuthConfig(),
TwitterCore.getInstance().getSessionManager(), AuthStateLazyHolder.INSTANCE);
}