本文整理匯總了Java中cn.sharesdk.framework.Platform.ACTION_SHARE屬性的典型用法代碼示例。如果您正苦於以下問題:Java Platform.ACTION_SHARE屬性的具體用法?Java Platform.ACTION_SHARE怎麽用?Java Platform.ACTION_SHARE使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類cn.sharesdk.framework.Platform
的用法示例。
在下文中一共展示了Platform.ACTION_SHARE屬性的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onError
@Override
public void onError(Platform platform, int action, Throwable e) {
L.e(CategoryActy_v_1.class, "[onError]platform:" + platform.getName());
mShareComplete = false;
if (action == Platform.ACTION_SHARE) {
if (platform.getName().equals(SinaWeibo.NAME)) {
if (e != null) {
SinaWeiboError error = new SinaWeiboError().fromJson(e.getMessage());
Toast.makeText(mContext, error.error_code == 20016 ?
R.string.d_m_edit_share_error_sina_weibo_update_too_fast_code_20016 :
R.string.d_m_edit_share_error_sina_weibo, Toast.LENGTH_LONG).show();
} else {
Toast.makeText(mContext, R.string.d_m_edit_share_error_sina_weibo, Toast.LENGTH_LONG).show();
}
} else if (platform.getName().equals(QZone.NAME)) {
//
} else if (platform.getName().equals(WechatMoments.NAME)) {
//
} else if (platform.getName().equals(Wechat.NAME)) {
//
} else if (platform.getName().equals(QQ.NAME)) {
//
}
}
}
示例2: onCancel
@Override
public void onCancel(Platform platform, int action) {
L.w(CategoryActy_v_1.class, "[onCancel]platform:" + platform.getName());
if (action == Platform.ACTION_SHARE) {
if (platform.getName().equals(SinaWeibo.NAME)) {
//
} else if (platform.getName().equals(QZone.NAME)) {
//
} else if (platform.getName().equals(WechatMoments.NAME)) {
//
} else if (platform.getName().equals(Wechat.NAME)) {
//
} else if (platform.getName().equals(QQ.NAME)) {
//
}
}
}
示例3: parseAction
private static String parseAction(int action) {
switch (action) {
case Platform.ACTION_AUTHORIZING:
return "ACTION_AUTHORIZING";
case Platform.ACTION_FOLLOWING_USER:
return "ACTION_FOLLOWING_USER";
case Platform.ACTION_GETTING_FRIEND_LIST:
return "ACTION_GETTING_FRIEND_LIST";
case Platform.ACTION_SENDING_DIRECT_MESSAGE:
return "ACTION_SENDING_DIRECT_MESSAGE";
case Platform.ACTION_SHARE:
return "ACTION_SHARE";
case Platform.ACTION_TIMELINE:
return "ACTION_TIMELINE";
case Platform.ACTION_USER_INFOR:
return "ACTION_USER_INFOR";
default:
return null;
}
}
示例4: onCancel
@Override
public void onCancel(Platform platform, int action) {
L.w(EditActy.class, "[onCancel]platform:" + platform.getName());
//parseAction(action);
if (action == Platform.ACTION_SHARE) {
if (platform.getName().equals(SinaWeibo.NAME)) {
//
} else if (platform.getName().equals(QZone.NAME)) {
//
} else if (platform.getName().equals(WechatMoments.NAME)) {
//
} else if (platform.getName().equals(Wechat.NAME)) {
//
} else if (platform.getName().equals(QQ.NAME)) {
//
}
}
}
示例5: onComplete
@Override
public void onComplete(Platform platform, int action, HashMap<String, Object> map) {
/*
L.d(WelcomeActy.class, "onComplete---platform:" + platform.getName());
parseAction(action);
if (map != null) {
for (Entry<String, Object> entry : map.entrySet()) {
L.i(WelcomeActy.class, "Map--key:" + entry.getKey() + ", value:" + entry.getValue());
}
}*/
switch (action) {
case Platform.ACTION_AUTHORIZING: //認證登錄
if (platform.getName().equals(QQ.NAME)) {
PlatformDb db = ShareSdk.getAuthorizeData(WelcomeActy.this, platform.getName());
loginWithQQ(db.getUserId());
return;
}
break;
case Platform.ACTION_FOLLOWING_USER:
break;
case Platform.ACTION_GETTING_FRIEND_LIST:
break;
case Platform.ACTION_SENDING_DIRECT_MESSAGE:
break;
case Platform.ACTION_SHARE:
break;
case Platform.ACTION_TIMELINE:
break;
case Platform.ACTION_USER_INFOR:
break;
}
updateLoginBtnState(true);
}
示例6: onComplete
@Override
public void onComplete(Platform platform, int action, HashMap<String, Object> map) {
L.d(CategoryActy_v_1.class, "[onComplete]platform:" + platform.getName());
mShareComplete = true;
if (action == Platform.ACTION_SHARE) {
if (platform.getName().equals(SinaWeibo.NAME)) {
//Platform.isSSODisable()與是否跳客戶端沒關係
L.e(CategoryActy_v_1.class, "complete---------------SinaWeibo");
/* 啟用了客戶端分享,但是在打開客戶端之前或者沒有安裝客戶端而直接進行了微博分享都會回調本方法,
* 而我無法分辨這兩種情況,沒有相關的方法或返回參數。
* 但有一個辦法:如果是打開客戶端,則會先執行onPause(),再執行本方法。so...
*/
if(!mPaused) {
//不跳頁,給來個Toast
Toast.makeText(mContext, R.string.d_m_edit_share_complete_sina_weibo, Toast.LENGTH_LONG).show();
mOkSinaWeibo = true;
resetState();
}
} else if (platform.getName().equals(QZone.NAME)) {
//正常跳頁且正確回調,但統一放到onStart()
} else if (platform.getName().equals(WechatMoments.NAME)) {
//不跳頁,且不會回調,但是會彈窗,因此會收到onPause()
L.e(CategoryActy_v_1.class, "complete---------------WechatMoments");
} else if (platform.getName().equals(Wechat.NAME)) {
//跳頁,但不會正確回調,返回即視為發布成功
} else if (platform.getName().equals(QQ.NAME)) {
//會跳頁,會正確回調,但是在跳頁之前回調,這裏等待跳頁回來調用onStart()
}
}
}
示例7: onError
@Override
public void onError(Platform platform, int action, Throwable e) {
L.e(EditActy.class, "[onError]platform:" + platform.getName());
//parseAction(action);
mShareComplete = false;
if (action == Platform.ACTION_SHARE) {
if (platform.getName().equals(SinaWeibo.NAME)) {
if (e != null) {
SinaWeiboError error = new SinaWeiboError().fromJson(e.getMessage());
Toast.makeText(mContext, error.error_code == 20016 ?
R.string.d_m_edit_share_error_sina_weibo_update_too_fast_code_20016 :
R.string.d_m_edit_share_error_sina_weibo, Toast.LENGTH_LONG).show();
} else {
Toast.makeText(mContext, R.string.d_m_edit_share_error_sina_weibo, Toast.LENGTH_LONG).show();
}
} else if (platform.getName().equals(QZone.NAME)) {
//
} else if (platform.getName().equals(WechatMoments.NAME)) {
//
} else if (platform.getName().equals(Wechat.NAME)) {
//
} else if (platform.getName().equals(QQ.NAME)) {
//
}
}
}
示例8: onComplete
@Override
public void onComplete(Platform platform, int action, HashMap<String, Object> map) {
L.d(EditActy.class, "[onComplete]platform:" + platform.getName());
//parseAction(action);
mShareComplete = true;
if (action == Platform.ACTION_SHARE) {
if (platform.getName().equals(SinaWeibo.NAME)) {
//Platform.isSSODisable()與是否跳客戶端沒關係
L.e(EditActy.class, "complete---------------SinaWeibo");
/* 啟用了客戶端分享,但是在打開客戶端之前或者沒有安裝客戶端而直接進行了微博分享都會回調本方法,
* 而我無法分辨這兩種情況,沒有相關的方法或返回參數。
* 但有一個辦法:如果是打開客戶端,則會先執行onPause(),再執行本方法。so...
*/
if(!mPaused) {
//不跳頁,給來個Toast
Toast.makeText(mContext, R.string.d_m_edit_share_complete_sina_weibo, Toast.LENGTH_LONG).show();
mOkSinaWeibo.setVisibility(View.VISIBLE);
resetState();
}
} else if (platform.getName().equals(QZone.NAME)) {
//正常跳頁且正確回調,但統一放到onStart()
//mOkQzone.setVisibility(View.VISIBLE);
} else if (platform.getName().equals(WechatMoments.NAME)) {
//不跳頁,且不會回調,但是會彈窗,因此會收到onPause()
L.e(EditActy.class, "complete---------------WechatMoments");
//mOkWechatMoments.setVisibility(View.VISIBLE);
} else if (platform.getName().equals(Wechat.NAME)) {
//跳頁,但不會正確回調,返回即視為發布成功
//mOkWechat.setVisibility(View.VISIBLE);
} else if (platform.getName().equals(QQ.NAME)) {
//會跳頁,會正確回調,但是在跳頁之前回調,這裏等待跳頁回來調用onStart()
//mOkQQ.setVisibility(View.VISIBLE);
}
}
}