當前位置: 首頁>>代碼示例>>Java>>正文


Java ShareSDK.initSDK方法代碼示例

本文整理匯總了Java中cn.sharesdk.framework.ShareSDK.initSDK方法的典型用法代碼示例。如果您正苦於以下問題:Java ShareSDK.initSDK方法的具體用法?Java ShareSDK.initSDK怎麽用?Java ShareSDK.initSDK使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在cn.sharesdk.framework.ShareSDK的用法示例。


在下文中一共展示了ShareSDK.initSDK方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: showShare

import cn.sharesdk.framework.ShareSDK; //導入方法依賴的package包/類
private void showShare() {
        ShareSDK.initSDK(this);
        OnekeyShare oks = new OnekeyShare();
        //隱藏
        oks.addHiddenPlatform(QQ.NAME);
        oks.addHiddenPlatform(SinaWeibo.NAME);
        oks.addHiddenPlatform(TencentWeibo.NAME);
        oks.addHiddenPlatform(QZone.NAME);
        oks.addHiddenPlatform(WechatFavorite.NAME);
        oks.addHiddenPlatform(Facebook.NAME);
        oks.addHiddenPlatform(Twitter.NAME);
        oks.addHiddenPlatform(ShortMessage.NAME);

        oks.disableSSOWhenAuthorize();
        String packgeName = mTextView_Title.getText().toString();
        if (!packgeName.isEmpty() && packgeName != "") {
            oks.setTitle(packgeName);
            mTitle = packgeName;
        } else {
            oks.setTitle(mTitle);
        }
        oks.setShareContentCustomizeCallback(new ShareContentCustomizeCallback() {
            @Override
            public void onShare(Platform platform, Platform.ShareParams paramsToShare) {
                if (WechatMoments.NAME.equals(platform.getName())) {
                    paramsToShare.setTitle(summary);
                }
            }
        });
        oks.setText(summary);
//        oks.setImagePath(mImageTemp+"/yyox.png");  //分享sdcard目錄下的圖片
        oks.setImageUrl(CommonUtils.getBaseUrl()+"/app/share/images/share.jpg");
        oks.setUrl(url + "?orderNo=" + searchNo + "&orderStatus=" + orderStatus + "&companyCode=" + companyCode + "&title=" + mTitle+"&customerId="+mCustomerId);
        oks.show(this);
    }
 
開發者ID:Zyj163,項目名稱:yyox,代碼行數:36,代碼來源:OrderTrackingActivity.java

示例2: b

import cn.sharesdk.framework.ShareSDK; //導入方法依賴的package包/類
private static void b(Context context, BMPlatform bMPlatform, b bVar) {
    String e = bVar.e();
    if (m.a().o()) {
        c.d("aaron share sdk");
        ShareSDK.initSDK(context);
        if (bMPlatform == BMPlatform.PLATFORM_WXSESSION) {
            com.zxinsight.share.c.a.a(context, bVar);
        } else if (bMPlatform == BMPlatform.PLATFORM_WXTIMELINE) {
            com.zxinsight.share.c.a.b(context, bVar);
        }
    } else if (bMPlatform == BMPlatform.PLATFORM_WXSESSION || bMPlatform == BMPlatform
            .PLATFORM_WXTIMELINE) {
        ActivityFactory activityFactory = new ActivityFactory(context, MWActivity
                .ACTIVITY_TYPE_WX);
        Intent intent = activityFactory.getIntent();
        MWWXHandlerActivity.setListener(b(bMPlatform));
        intent.putExtra("platform", bMPlatform);
        intent.putExtra("fromShare", true);
        intent.putExtra("realUrl", e);
        MWWXEntryActivity.shareData = bVar;
        activityFactory.startActivity();
    }
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:24,代碼來源:a.java

示例3: show

import cn.sharesdk.framework.ShareSDK; //導入方法依賴的package包/類
@SuppressWarnings("unchecked")
public void show(Context context) {
	HashMap<String, Object> shareParamsMap = new HashMap<String, Object>();
	shareParamsMap.putAll(params);

	ShareSDK.initSDK(context);

	// 打開分享菜單的統計
	ShareSDK.logDemoEvent(1, null);

	int iTheme = 0;
	try {
		iTheme = com.mob.tools.utils.R.parseInt(String.valueOf(shareParamsMap.remove("theme")));
	} catch (Throwable t) {}
	OnekeyShareTheme theme = OnekeyShareTheme.fromValue(iTheme);
	OnekeyShareThemeImpl themeImpl = theme.getImpl();

	themeImpl.setShareParamsMap(shareParamsMap);
	themeImpl.setDialogMode(shareParamsMap.containsKey("dialogMode") ? ((Boolean) shareParamsMap.remove("dialogMode")) : false);
	themeImpl.setSilent(shareParamsMap.containsKey("silent") ? ((Boolean) shareParamsMap.remove("silent")) : false);
	themeImpl.setCustomerLogos((ArrayList<CustomerLogo>) shareParamsMap.remove("customers"));
	themeImpl.setHiddenPlatforms((HashMap<String, String>) shareParamsMap.remove("hiddenPlatforms"));
	themeImpl.setPlatformActionListener((PlatformActionListener) shareParamsMap.remove("callback"));
	themeImpl.setShareContentCustomizeCallback((ShareContentCustomizeCallback) shareParamsMap.remove("customizeCallback"));
	if (shareParamsMap.containsKey("disableSSO") ? ((Boolean) shareParamsMap.remove("disableSSO")) : false) {
		themeImpl.disableSSO();
	}

	themeImpl.show(context);
}
 
開發者ID:wp521,項目名稱:MyFire,代碼行數:31,代碼來源:OnekeyShare.java

示例4: init

import cn.sharesdk.framework.ShareSDK; //導入方法依賴的package包/類
private void init() {
    mHandler = new Handler(this);
    ShareSDK.initSDK(getContext());
    Platform platform = ShareSDK.getPlatform(QQ.NAME);
    if (platform.isAuthValid()) {
        showUser(platform);
    }
}
 
開發者ID:Leavessilent,項目名稱:QuanMinTV,代碼行數:9,代碼來源:MineFragment.java

示例5: showShare

import cn.sharesdk.framework.ShareSDK; //導入方法依賴的package包/類
private void showShare() {
    ShareSDK.initSDK(this);
    OnekeyShare oks = new OnekeyShare();
    oks.disableSSOWhenAuthorize();

    oks.setTitle("tl");
    oks.setTitleUrl("http://fir.im/6md5");
    oks.setText("田亮");
    oks.setImagePath("file:///android_asset/home_iamge2.png");
    oks.setUrl("http://fir.im/6md5");
    oks.setComment("我是測試評論文本");
    oks.setSite(getString(R.string.app_name));
    oks.setSiteUrl("http://fir.im/6md5");
    oks.show(this);
}
 
開發者ID:Zyj163,項目名稱:yyox,代碼行數:16,代碼來源:UserInviteActivity.java

示例6: show

import cn.sharesdk.framework.ShareSDK; //導入方法依賴的package包/類
@SuppressWarnings("unchecked")
public void show(Context context) {
	HashMap<String, Object> shareParamsMap = new HashMap<String, Object>();
	shareParamsMap.putAll(params);

	MobSDK.init(context.getApplicationContext());
	ShareSDK.initSDK(context);

	// 打開分享菜單的統計
	ShareSDK.logDemoEvent(1, null);

	int iTheme = 0;
	try {
		iTheme = ResHelper.parseInt(String.valueOf(shareParamsMap.remove("theme")));
	} catch (Throwable t) {}
	OnekeyShareTheme theme = OnekeyShareTheme.fromValue(iTheme);
	OnekeyShareThemeImpl themeImpl = theme.getImpl();

	themeImpl.setShareParamsMap(shareParamsMap);
	themeImpl.setDialogMode(shareParamsMap.containsKey("dialogMode") ? ((Boolean) shareParamsMap.remove("dialogMode")) : false);
	themeImpl.setSilent(shareParamsMap.containsKey("silent") ? ((Boolean) shareParamsMap.remove("silent")) : false);
	themeImpl.setCustomerLogos((ArrayList<CustomerLogo>) shareParamsMap.remove("customers"));
	themeImpl.setHiddenPlatforms((HashMap<String, String>) shareParamsMap.remove("hiddenPlatforms"));
	themeImpl.setPlatformActionListener((PlatformActionListener) shareParamsMap.remove("callback"));
	themeImpl.setShareContentCustomizeCallback((ShareContentCustomizeCallback) shareParamsMap.remove("customizeCallback"));
	if (shareParamsMap.containsKey("disableSSO") ? ((Boolean) shareParamsMap.remove("disableSSO")) : false) {
		themeImpl.disableSSO();
	}

	themeImpl.show(context.getApplicationContext());
}
 
開發者ID:Zyj163,項目名稱:yyox,代碼行數:32,代碼來源:OnekeyShare.java

示例7: onCreate

import cn.sharesdk.framework.ShareSDK; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_trip_detail);
    ButterKnife.bind(this);
    getData();
    initToolbar();
    initWebView();
    ShareSDK.initSDK(this);
}
 
開發者ID:yiwent,項目名稱:Mobike,代碼行數:11,代碼來源:TripDetailActivity.java

示例8: show

import cn.sharesdk.framework.ShareSDK; //導入方法依賴的package包/類
@SuppressWarnings("unchecked")
public void show(Context context) {
	HashMap<String, Object> shareParamsMap = new HashMap<String, Object>();
	shareParamsMap.putAll(params);

	ShareSDK.initSDK(context.getApplicationContext());

	// 打開分享菜單的統計
	ShareSDK.logDemoEvent(1, null);

	int iTheme = 0;
	try {
		iTheme = ResHelper.parseInt(String.valueOf(shareParamsMap.remove("theme")));
	} catch (Throwable t) {}
	OnekeyShareTheme theme = OnekeyShareTheme.fromValue(iTheme);
	OnekeyShareThemeImpl themeImpl = theme.getImpl();

	themeImpl.setShareParamsMap(shareParamsMap);
	themeImpl.setDialogMode(shareParamsMap.containsKey("dialogMode") ? ((Boolean) shareParamsMap.remove("dialogMode")) : false);
	themeImpl.setSilent(shareParamsMap.containsKey("silent") ? ((Boolean) shareParamsMap.remove("silent")) : false);
	themeImpl.setCustomerLogos((ArrayList<CustomerLogo>) shareParamsMap.remove("customers"));
	themeImpl.setHiddenPlatforms((HashMap<String, String>) shareParamsMap.remove("hiddenPlatforms"));
	themeImpl.setPlatformActionListener((PlatformActionListener) shareParamsMap.remove("callback"));
	themeImpl.setShareContentCustomizeCallback((ShareContentCustomizeCallback) shareParamsMap.remove("customizeCallback"));
	if (shareParamsMap.containsKey("disableSSO") ? ((Boolean) shareParamsMap.remove("disableSSO")) : false) {
		themeImpl.disableSSO();
	}

	themeImpl.show(context.getApplicationContext());
}
 
開發者ID:Leavessilent,項目名稱:QuanMinTV,代碼行數:31,代碼來源:OnekeyShare.java

示例9: show

import cn.sharesdk.framework.ShareSDK; //導入方法依賴的package包/類
@SuppressWarnings("unchecked")
public void show(Context context) {
	HashMap<String, Object> shareParamsMap = new HashMap<String, Object>();
	shareParamsMap.putAll(params);

	ShareSDK.initSDK(context);

	// 打開分享菜單的統計
	ShareSDK.logDemoEvent(1, null);

	int iTheme = 0;
	try {
		iTheme = R.parseInt(String.valueOf(shareParamsMap.remove("theme")));
	} catch (Throwable t) {}
	OnekeyShareTheme theme = OnekeyShareTheme.fromValue(iTheme);
	OnekeyShareThemeImpl themeImpl = theme.getImpl();

	themeImpl.setShareParamsMap(shareParamsMap);
	themeImpl.setDialogMode(shareParamsMap.containsKey("dialogMode") ? ((Boolean) shareParamsMap.remove("dialogMode")) : false);
	themeImpl.setSilent(shareParamsMap.containsKey("silent") ? ((Boolean) shareParamsMap.remove("silent")) : false);
	themeImpl.setCustomerLogos((ArrayList<CustomerLogo>) shareParamsMap.remove("customers"));
	themeImpl.setHiddenPlatforms((HashMap<String, String>) shareParamsMap.remove("hiddenPlatforms"));
	themeImpl.setPlatformActionListener((PlatformActionListener) shareParamsMap.remove("callback"));
	themeImpl.setShareContentCustomizeCallback((ShareContentCustomizeCallback) shareParamsMap.remove("customizeCallback"));
	if (shareParamsMap.containsKey("disableSSO") ? ((Boolean) shareParamsMap.remove("disableSSO")) : false) {
		themeImpl.disableSSO();
	}

	themeImpl.show(context);
}
 
開發者ID:Jusenr,項目名稱:androidgithub,代碼行數:31,代碼來源:OnekeyShare.java

示例10: onCreate

import cn.sharesdk.framework.ShareSDK; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_invite_friend);
    ButterKnife.bind(this);
    ShareSDK.initSDK(this);
    initEvent();
}
 
開發者ID:yiwent,項目名稱:Mobike,代碼行數:9,代碼來源:InviteFriendActivity.java

示例11: onCreate

import cn.sharesdk.framework.ShareSDK; //導入方法依賴的package包/類
@Override
public void onCreate() {
    super.onCreate();
    LitePal.initialize(this);
    //初始化融雲
    initRongCloud();
    //初始化紅包
    initRedPacket();
    //初始化仿微信控件ImagePicker
    initImagePicker();
    //初始化表情控件
    LQREmotionKit.init(this, (context, path, imageView) -> Glide.with(context).load(path).centerCrop().diskCacheStrategy(DiskCacheStrategy.SOURCE).into(imageView));
    //初始化ShareSDK
    ShareSDK.initSDK(getContext());
}
 
開發者ID:starryxp,項目名稱:LQRWeChat-master,代碼行數:16,代碼來源:MyApp.java

示例12: showShare

import cn.sharesdk.framework.ShareSDK; //導入方法依賴的package包/類
private void showShare(String shareText) {
ShareSDK.initSDK(this);
      OnekeyShare oks = new OnekeyShare();
      //關閉sso授權
      oks.disableSSOWhenAuthorize();
      // 分享時Notification的圖標和文字
      oks.setNotification(R.drawable.ic_launcher, getString(R.string.app_name));
      // title標題,印象筆記、郵箱、信息、微信、人人網和QQ空間使用
      oks.setTitle("火車行");
      // titleUrl是標題的網絡鏈接,僅在人人網和QQ空間使用
      oks.setTitleUrl(WEB_SITE);
      // text是分享文本,所有平台都需要這個字段
      oks.setText(shareText);
      // imagePath是圖片的本地路徑,Linked-In以外的平台都支持此參數
      oks.setImagePath(imageDataPath);
      // url僅在微信(包括好友和朋友圈)中使用
      oks.setUrl(WEB_SITE);
      // comment是我對這條分享的評論,僅在人人網和QQ空間使用
      oks.setComment(shareText);
      // site是分享此內容的網站名稱,僅在QQ空間使用
      oks.setSite(getString(R.string.app_name));
      // siteUrl是分享此內容的網站地址,僅在QQ空間使用
      oks.setSiteUrl(WEB_SITE);

      // 啟動分享GUI
      oks.show(this);
 }
 
開發者ID:SShineTeam,項目名稱:Huochexing12306,代碼行數:28,代碼來源:ShareContentAty.java

示例13: onCreate

import cn.sharesdk.framework.ShareSDK; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_message_detail);
    ButterKnife.bind(this);
    getData();
    initToolbar();
    initWebView();
    ShareSDK.initSDK(this);
}
 
開發者ID:yiwent,項目名稱:Mobike,代碼行數:11,代碼來源:MessageDetailActivity.java

示例14: onCreate

import cn.sharesdk.framework.ShareSDK; //導入方法依賴的package包/類
@Override
    public void onCreate() {
        super.onCreate();

        app = this;

        // 存放所有activity的集合
        mActivityList = new ArrayList<>();

        // 初始化app異常處理器 - 打包的時候開啟
//        CrashHandler handler = CrashHandler.getInstance();
//        handler.init(getApplicationContext());

        // 初始化OkHttpUtils
        OkHttpClient okHttpClient = new OkHttpClient.Builder()
                .connectTimeout(10000L, TimeUnit.MILLISECONDS)
                .readTimeout(10000L, TimeUnit.MILLISECONDS)
                //其他配置
                .build();
        OkHttpUtils.initClient(okHttpClient);

        // 初始化Fresco
        ImagePipelineConfig config = ImagePipelineConfig.newBuilder(this)
                .setProgressiveJpegConfig(new SimpleProgressiveJpegConfig())
                .build();
        Fresco.initialize(this, config);

        // 初始化ShareSDK
        ShareSDK.initSDK(this);

        // 初始化JPush
        JPushInterface.setDebugMode(true);
        JPushInterface.init(this);

        // 更新用戶登錄狀態
        UserBean.updateUserInfoFromNetwork(new UserBean.OnUpdatedUserInfoListener());

    }
 
開發者ID:6ag,項目名稱:LiuAGeAndroid,代碼行數:39,代碼來源:App.java

示例15: ensureInit

import cn.sharesdk.framework.ShareSDK; //導入方法依賴的package包/類
private static void ensureInit(Context context) {
	checkIsParamValid(context);
	ShareSDK.initSDK(context.getApplicationContext());
}
 
開發者ID:isuhao,項目名稱:QMark,代碼行數:5,代碼來源:ShareSdk.java


注:本文中的cn.sharesdk.framework.ShareSDK.initSDK方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。