本文整理汇总了Java中com.umeng.socialize.UMShareAPI类的典型用法代码示例。如果您正苦于以下问题:Java UMShareAPI类的具体用法?Java UMShareAPI怎么用?Java UMShareAPI使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
UMShareAPI类属于com.umeng.socialize包,在下文中一共展示了UMShareAPI类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import com.umeng.socialize.UMShareAPI; //导入依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
// 设置异常捕获处理类
Thread.setDefaultUncaughtExceptionHandler(new ExceptionHandler(this));
Session.get(this);
mInstance = this;
MobclickAgent.openActivityDurationTrack(false);
//初始化友盟分享
//开启debug模式,方便定位错误,具体错误检查方式可以查看http://dev.umeng.com/social/android/quick-integration的报错必看,正式发布,请关闭该模式
// Config.DEBUG = true;
UMShareAPI.get(this);
initCacheFile(this);
OpenInstall.init(this);
//打开调试,便于看到Log
OpenInstall.setDebug(false);
initUmengPush();
}
示例2: onDestroy
import com.umeng.socialize.UMShareAPI; //导入依赖的package包/类
@Override
protected void onDestroy() {
UMShareAPI.get(this).release();
mWebView.onDestroy();
mWebView.destroyDrawingCache();
if(mProjectionService!=null) {
mProjectionService.stopQuerySeek();
}
if (mHandler != null) {
mHandler.removeCallbacksAndMessages(null);
}
if (mServiceConn!=null){
unbindService(mServiceConn);
}
super.onDestroy();
}
示例3: onActivityResult
import com.umeng.socialize.UMShareAPI; //导入依赖的package包/类
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
UMShareAPI.get(this).onActivityResult(requestCode, resultCode, data);
if(resultCode == EXTRA_FROM_RECOMMEND) {
mBackFromInternal = true;
}else if(resultCode == EXTRA_TV_INFO){
mBackFromInternal = true;
} else if (resultCode == SCAN_QR) {
if(data!=null) {
String scanResult = data.getStringExtra("scan_result");
mBindTvPresenter.handleQrcodeResult(scanResult);
LogUtils.d("扫描结果:" + scanResult);
}
mBackFromInternal = true;
}else if(resultCode == FROM_APP_BACK) {
mBackFromInternal = true;
}else if(resultCode == EXTRA_BIND_CANCLE) {
mBackFromInternal = true;
}
}
示例4: onActivityResult
import com.umeng.socialize.UMShareAPI; //导入依赖的package包/类
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
// 根据上面发送过去的请求吗来区别
super.onActivityResult(requestCode, resultCode, data);
UMShareAPI.get(this).onActivityResult(requestCode, resultCode, data);
switch (requestCode) {
case 555:
int code = resultCode;
switch (code){
case 111:
AppApi.isCollection(mContext,this,content_id);
break;
case 222:
finish();
break;
}
break;
case 2:
break;
default:
break;
}
}
示例5: onCreate
import com.umeng.socialize.UMShareAPI; //导入依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
mContext = getApplicationContext();
Utils.init(mContext);
//友盟初始化
UMShareAPI.get(this);
/**
* 初始化数据库
*/
DaoMaster.DevOpenHelper devOpenHelper = new DaoMaster.DevOpenHelper(mContext, "test-db");
Database writableDb = devOpenHelper.getWritableDb();
daoSession = new DaoMaster(writableDb).newSession();
initCrashHandler();
initX5Environment();//x5内核初始化接口
}
示例6: onCreate
import com.umeng.socialize.UMShareAPI; //导入依赖的package包/类
@Override
public void onCreate() {
MultiDex.install(this);
super.onCreate();
instance = this;
aCache = ACache.get(this);
DemoHelper.getInstance().init(this);
SDKInitializer.initialize(this);
EMClient.getInstance().init(this, initChatOptions());
EMClient.getInstance().setDebugMode(true);
initRedPacket();
// F.setLog(false);
// //崩溃处理
CrashHandlerUtil crashHandlerUtil = CrashHandlerUtil.getInstance();
crashHandlerUtil.init(this);
crashHandlerUtil.setCrashTip("很抱歉,程序出现异常,即将退出!");
Config.DEBUG = true;
initUM();
QueuedWork.isUseThreadPool = false;
UMShareAPI.get(this);
}
示例7: onCreate
import com.umeng.socialize.UMShareAPI; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
ButterKnife.bind(this);
mShareAPI = UMShareAPI.get(this);
mContext = this;
initView();
initCountryList();
setListener();
initListener();
// ATTENTION: This was auto-generated to implement the App Indexing API.
// See https://g.co/AppIndexing/AndroidStudio for more information.
client = new GoogleApiClient.Builder(this).addApi(AppIndex.API).build();
}
示例8: getView
import com.umeng.socialize.UMShareAPI; //导入依赖的package包/类
@Override
public View getView(final int position, View convertView, ViewGroup parent) {
if (convertView == null) {
convertView = LayoutInflater.from(mContext).inflate(R.layout.app_authadapter, null);
}
final boolean isauth = UMShareAPI.get(mContext).isAuthorize(mActivity, list.get(position).mPlatform);
ImageView img = (ImageView) convertView.findViewById(R.id.adapter_image);
img.setImageResource(ResContainer.getResourceId(mContext, "drawable", list.get(position).mIcon));
TextView tv = (TextView) convertView.findViewById(R.id.name);
tv.setText(ResContainer.getResourceId(mContext, "string", list.get(position).mShowWord));
TextView authBtn = (TextView) convertView.findViewById(R.id.auth_button);
if (isauth) {
authBtn.setText("删除授权");
} else {
authBtn.setText("授权");
}
authBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (isauth) {
UMShareAPI.get(mContext).deleteOauth(mActivity, list.get(position).mPlatform, authListener);
} else {
UMShareAPI.get(mContext).doOauthVerify(mActivity, list.get(position).mPlatform, authListener);
}
}
});
if (position == list.size() - 1) {
convertView.findViewById(R.id.divider).setVisibility(View.GONE);
} else {
convertView.findViewById(R.id.divider).setVisibility(View.VISIBLE);
}
//
return convertView;
}
示例9: onCreate
import com.umeng.socialize.UMShareAPI; //导入依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
//开启debug模式,方便定位错误,具体错误检查方式可以查看http://dev.umeng.com/social/android/quick-integration的报错必看,正式发布,请关闭该模式
Config.DEBUG = true;
UMShareAPI.get(this);
}
示例10: init
import com.umeng.socialize.UMShareAPI; //导入依赖的package包/类
public static void init(Context context1,String sinaCallbackUrl,boolean degbug,SHARE_MEDIA... shareMediaList){
context = context1;
// UMShareAPI.get(context1);
Config.REDIRECT_URL = sinaCallbackUrl;//http://sns.whalecloud.com/sina2/callback
shareMedias = shareMediaList;
Config.isJumptoAppStore = true;
Config.DEBUG = degbug;
umShareAPI = UMShareAPI.get(context1);
//对应平台没有安装的时候跳转转到应用商店下载,其中qq 微信会跳转到下载界面进行下载,其他应用会跳到应用商店进行下载
//友盟统计
MobclickAgent.setScenarioType(context, MobclickAgent.EScenarioType. E_UM_NORMAL);
}
示例11: onActivityResult
import com.umeng.socialize.UMShareAPI; //导入依赖的package包/类
/**
* @param requestCode
* @param resultCode
* @param data
* @功能描述 : 如果有使用任一平台的SSO授权或者集成了facebook平台, 则必须在对应的activity中实现onActivityResult方法.
*/
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
/**使用SSO授权必须添加如下代码 */
UMShareAPI.get(this).onActivityResult(requestCode, resultCode, data);
}
示例12: onActivityResult
import com.umeng.socialize.UMShareAPI; //导入依赖的package包/类
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
/** attention to this below ,must add this**/
UMShareAPI.get(this).onActivityResult(requestCode, resultCode, data);
Log.d("result","onActivityResult");
}
示例13: onCreate
import com.umeng.socialize.UMShareAPI; //导入依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
mContext = getApplicationContext();
initUtil();
initTheme();
//友盟异常捕获
MobclickAgent.setCatchUncaughtExceptions(true);
MobclickAgent.setDebugMode(BuildConfig.DEBUG);
//字体
Util.setFontSize(this);
//友盟分享
UMShareAPI.get(this);
Config.DEBUG = BuildConfig.DEBUG;
//bomb
Bmob.initialize(this, "0c070110fffa9e88a1362643fb9d4d64");
BmobUpdateAgent.setUpdateOnlyWifi(false);
BmobUpdateAgent.update(this);
//禁止默认的页面统计方式
MobclickAgent.openActivityDurationTrack(false);
//异常捕获
CrashHandler crashHandler = CrashHandler.getInstance();
crashHandler.init(this);
//检测内存泄漏
if(!LeakCanary.isInAnalyzerProcess(this)){
LeakCanary.install(this);
}
//AppShortcut
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.N_MR1)
new DynamicShortcutManager(this).setUpShortcut();
}
示例14: initUmengShare
import com.umeng.socialize.UMShareAPI; //导入依赖的package包/类
private void initUmengShare() {
PlatformConfig.setWeixin(ConstantValues.WECHAT_ID, ConstantValues.WECHAT_SECRET);
PlatformConfig.setSinaWeibo(ConstantValues.SINA_KEY, ConstantValues.SINA_SECRET);
PlatformConfig.setQQZone(ConstantValues.TENCENT_ID, ConstantValues.TENCENT_SECRET);
Config.REDIRECT_URL = ConstantValues.SINA_REDIRECT_URL;
Config.DEBUG = BuildConfig.DEBUG;
Config.isJumptoAppStore = true;
UMShareAPI.get(appContext);
}
示例15: onActivityResult
import com.umeng.socialize.UMShareAPI; //导入依赖的package包/类
/**
* 友盟分享回调类
*/
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
//attention to this below ,must add this
//友盟社会化分享
UMShareAPI.get(this).onActivityResult(requestCode, resultCode, data);
Log.d("result", "onActivityResult");
}