本文整理汇总了Java中com.tencent.open.utils.ThreadManager类的典型用法代码示例。如果您正苦于以下问题:Java ThreadManager类的具体用法?Java ThreadManager怎么用?Java ThreadManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ThreadManager类属于com.tencent.open.utils包,在下文中一共展示了ThreadManager类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: doShareToQQ
import com.tencent.open.utils.ThreadManager; //导入依赖的package包/类
/**
* 用异步方式启动分享
* @param params
*/
private void doShareToQQ(final Activity activity,final Bundle params) {
// QQ分享要在主线程做
ThreadManager.getMainHandler().post(new Runnable() {
@Override
public void run() {
if (mQQShare != null) {
mQQShare.shareToQQ(activity, params, iUiListener);
}
}
});
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:16,代码来源:QQShareManager.java
示例2: onActivityResult
import com.tencent.open.utils.ThreadManager; //导入依赖的package包/类
public void onActivityResult(Activity activity, int i, int i2, Intent intent) {
IUiListener iUiListener;
ThreadManager.executeOnSubThread(new Runnable(this) {
final /* synthetic */ AuthAgent a;
{
this.a = r1;
}
public void run() {
Global.saveVersionCode();
}
});
for (ApiTask apiTask : this.mTaskList) {
if (apiTask.mRequestCode == i) {
IUiListener iUiListener2 = apiTask.mListener;
this.mTaskList.remove(apiTask);
iUiListener = iUiListener2;
break;
}
}
iUiListener = null;
if (intent != null) {
a(intent.getStringExtra(com.tencent.connect.common.Constants.KEY_RESPONSE));
if (iUiListener == null) {
AssistActivity.setResultDataForLogin(activity, intent);
return;
}
if (i2 == -1) {
BaseApi.handleDataToListener(intent, iUiListener);
} else {
f.b(f.d, "OpenUi, onActivityResult, Constants.ACTIVITY_CANCEL");
iUiListener.onCancel();
}
releaseResource();
f.b();
} else if (iUiListener != null) {
iUiListener.onCancel();
}
}
开发者ID:JackChan1999,项目名称:letv,代码行数:41,代码来源:AuthAgent.java
示例3: onActivityResult
import com.tencent.open.utils.ThreadManager; //导入依赖的package包/类
public void onActivityResult(Activity activity, int i, int i2, Intent intent) {
IUiListener iUiListener;
ThreadManager.executeOnSubThread(new Runnable(this) {
final /* synthetic */ AuthAgent a;
{
this.a = r1;
}
public void run() {
Global.saveVersionCode();
}
});
for (ApiTask apiTask : this.mTaskList) {
if (apiTask.mRequestCode == i) {
IUiListener iUiListener2 = apiTask.mListener;
this.mTaskList.remove(apiTask);
iUiListener = iUiListener2;
break;
}
}
iUiListener = null;
if (intent != null) {
a(intent.getStringExtra(Constants.KEY_RESPONSE));
if (iUiListener == null) {
AssistActivity.setResultDataForLogin(activity, intent);
return;
}
if (i2 == -1) {
BaseApi.handleDataToListener(intent, iUiListener);
} else {
f.b(f.d, "OpenUi, onActivityResult, Constants.ACTIVITY_CANCEL");
iUiListener.onCancel();
}
releaseResource();
f.b();
} else if (iUiListener != null) {
iUiListener.onCancel();
}
}
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:41,代码来源:AuthAgent.java
示例4: share2QQ
import com.tencent.open.utils.ThreadManager; //导入依赖的package包/类
/**
* 分享到QQ
*/
public void share2QQ(){
//调用QQ分享SDK
final Tencent tencent = Tencent.createInstance("222222", mContext);
final Bundle params = new Bundle();
params.putString(QQShare.SHARE_TO_QQ_TITLE, response.category);
params.putString(QQShare.SHARE_TO_QQ_TARGET_URL, response.url);
params.putString(QQShare.SHARE_TO_QQ_SUMMARY, response.title);
params.putString(QQShare.SHARE_TO_QQ_IMAGE_URL, response.thumbnail_pic_s);
ThreadManager.getMainHandler().post(new Runnable() {
@Override
public void run() {
if (null != tencent) {
tencent.shareToQQ((Activity) mContext, params, new IUiListener() {
@Override
public void onComplete(Object o) {
AbToastUtil.showToast(mContext, "" + "分享成功");
}
@Override
public void onError(UiError uiError) {
AbToastUtil.showToast(mContext, "" + "分享失败");
}
@Override
public void onCancel() {
AbToastUtil.showToast(mContext, "" + "取消分析");
}
});
}
}
});
}
开发者ID:43081438,项目名称:RxJavaAndRetrofitSimple,代码行数:35,代码来源:ShareDialog.java
示例5: doShareToQZone
import com.tencent.open.utils.ThreadManager; //导入依赖的package包/类
/**
* 用异步方式启动分享
*
* @param params
*/
private void doShareToQZone(final Activity activity, final Bundle params) {
// QQ分享要在主线程做
ThreadManager.getMainHandler().post(new Runnable() {
@Override
public void run() {
if (mQZoneShare != null) {
mQZoneShare.shareToQzone(activity, params, iUiListener);
}
}
});
}
开发者ID:henjue,项目名称:sharesdk,代码行数:17,代码来源:QQShareManager.java
示例6: doShareToQQ
import com.tencent.open.utils.ThreadManager; //导入依赖的package包/类
/**
* 用异步方式启动分享
*
* @param params
*/
private void doShareToQQ(final Activity activity, final Bundle params) {
// QQ分享要在主线程做
ThreadManager.getMainHandler().post(new Runnable() {
@Override
public void run() {
if (mQQShare != null) {
mQQShare.shareToQQ(activity, params, iUiListener);
}
}
});
}
开发者ID:henjue,项目名称:sharesdk,代码行数:17,代码来源:QQShareManager.java
示例7: onCancel
import com.tencent.open.utils.ThreadManager; //导入依赖的package包/类
@Override
public void onCancel() {
sharesdk.deleteOnExit();
ThreadManager.getMainHandler().post(new Runnable() {
@Override
public void run() {
mListener.onCancel();
}
});
}
开发者ID:henjue,项目名称:sharesdk,代码行数:11,代码来源:QQShareManager.java
示例8: onComplete
import com.tencent.open.utils.ThreadManager; //导入依赖的package包/类
@Override
public void onComplete(Object response) {
sharesdk.deleteOnExit();
ThreadManager.getMainHandler().post(new Runnable() {
@Override
public void run() {
mListener.onSuccess();
}
});
}
开发者ID:henjue,项目名称:sharesdk,代码行数:11,代码来源:QQShareManager.java
示例9: onError
import com.tencent.open.utils.ThreadManager; //导入依赖的package包/类
@Override
public void onError(UiError e) {
sharesdk.deleteOnExit();
ThreadManager.getMainHandler().post(new Runnable() {
@Override
public void run() {
mListener.onFaild();
}
});
}
开发者ID:henjue,项目名称:sharesdk,代码行数:11,代码来源:QQShareManager.java
示例10: a
import com.tencent.open.utils.ThreadManager; //导入依赖的package包/类
private int a(boolean z, IUiListener iUiListener) {
f.c(f.d, "OpenUi, showDialog -- start");
CookieSyncManager.createInstance(Global.getContext());
Bundle composeCGIParams = composeCGIParams();
if (z) {
composeCGIParams.putString("isadd", "1");
}
composeCGIParams.putString("scope", this.b);
composeCGIParams.putString("client_id", this.mToken.getAppId());
if (isOEM) {
composeCGIParams.putString(com.tencent.connect.common.Constants.PARAM_PLATFORM_ID, "desktop_m_qq-" + installChannel + NetworkUtils.DELIMITER_LINE + AbstractSpiCall.ANDROID_CLIENT_TYPE + NetworkUtils.DELIMITER_LINE + registerChannel + NetworkUtils.DELIMITER_LINE + businessId);
} else {
composeCGIParams.putString(com.tencent.connect.common.Constants.PARAM_PLATFORM_ID, com.tencent.connect.common.Constants.DEFAULT_PF);
}
String str = (System.currentTimeMillis() / 1000) + "";
composeCGIParams.putString(TradeInfo.SIGN, SystemUtils.getAppSignatureMD5(Global.getContext(), str));
composeCGIParams.putString("time", str);
composeCGIParams.putString("display", "mobile");
composeCGIParams.putString("response_type", UserInfoDb.TOKEN);
composeCGIParams.putString("redirect_uri", ServerSetting.DEFAULT_REDIRECT_URI);
composeCGIParams.putString("cancel_display", "1");
composeCGIParams.putString("switch", "1");
composeCGIParams.putString("status_userip", Util.getUserIp());
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append(ServerSetting.getInstance().getEnvUrl(Global.getContext(), ServerSetting.DEFAULT_CGI_AUTHORIZE));
stringBuilder.append(Util.encodeUrl(composeCGIParams));
final String stringBuilder2 = stringBuilder.toString();
final IUiListener tokenListener = new TokenListener(this, Global.getContext(), iUiListener, true, false);
f.b(f.d, "OpenUi, showDialog TDialog");
ThreadManager.executeOnSubThread(new Runnable(this) {
final /* synthetic */ AuthAgent c;
public void run() {
SystemUtils.extractSecureLib(AuthAgent.SECURE_LIB_FILE_NAME, AuthAgent.SECURE_LIB_NAME, 2);
this.c.c.runOnUiThread(new Runnable(this) {
final /* synthetic */ AnonymousClass1 a;
{
this.a = r1;
}
public void run() {
new AuthDialog(this.a.c.c, SystemUtils.ACTION_LOGIN, stringBuilder2, tokenListener, this.a.c.mToken).show();
}
});
}
});
f.c(f.d, "OpenUi, showDialog -- end");
return 2;
}
开发者ID:JackChan1999,项目名称:letv,代码行数:51,代码来源:AuthAgent.java
示例11: a
import com.tencent.open.utils.ThreadManager; //导入依赖的package包/类
private int a(boolean z, IUiListener iUiListener) {
f.c(f.d, "OpenUi, showDialog -- start");
CookieSyncManager.createInstance(Global.getContext());
Bundle composeCGIParams = composeCGIParams();
if (z) {
composeCGIParams.putString("isadd", "1");
}
composeCGIParams.putString("scope", this.b);
composeCGIParams.putString(Constants.PARAM_CLIENT_ID, this.mToken.getAppId());
if (isOEM) {
composeCGIParams.putString(Constants.PARAM_PLATFORM_ID, "desktop_m_qq-" +
installChannel + SocializeConstants.OP_DIVIDER_MINUS + DeviceInfoConstant
.OS_ANDROID + SocializeConstants.OP_DIVIDER_MINUS + registerChannel +
SocializeConstants.OP_DIVIDER_MINUS + businessId);
} else {
composeCGIParams.putString(Constants.PARAM_PLATFORM_ID, Constants.DEFAULT_PF);
}
String str = (System.currentTimeMillis() / 1000) + "";
composeCGIParams.putString("sign", SystemUtils.getAppSignatureMD5(Global.getContext(),
str));
composeCGIParams.putString("time", str);
composeCGIParams.putString("display", "mobile");
composeCGIParams.putString("response_type", "token");
composeCGIParams.putString("redirect_uri", ServerSetting.DEFAULT_REDIRECT_URI);
composeCGIParams.putString("cancel_display", "1");
composeCGIParams.putString("switch", "1");
composeCGIParams.putString("status_userip", Util.getUserIp());
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append(ServerSetting.getInstance().getEnvUrl(Global.getContext(),
ServerSetting.DEFAULT_CGI_AUTHORIZE));
stringBuilder.append(Util.encodeUrl(composeCGIParams));
final String stringBuilder2 = stringBuilder.toString();
final IUiListener tokenListener = new TokenListener(this, Global.getContext(),
iUiListener, true, false);
f.b(f.d, "OpenUi, showDialog TDialog");
ThreadManager.executeOnSubThread(new Runnable(this) {
final /* synthetic */ AuthAgent c;
public void run() {
SystemUtils.extractSecureLib(AuthAgent.SECURE_LIB_FILE_NAME, AuthAgent
.SECURE_LIB_NAME, 2);
this.c.c.runOnUiThread(new Runnable(this) {
final /* synthetic */ AnonymousClass1 a;
{
this.a = r1;
}
public void run() {
new AuthDialog(this.a.c.c, SystemUtils.ACTION_LOGIN, stringBuilder2,
tokenListener, this.a.c.mToken).show();
}
});
}
});
f.c(f.d, "OpenUi, showDialog -- end");
return 2;
}
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:59,代码来源:AuthAgent.java
注:本文中的com.tencent.open.utils.ThreadManager类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论