/** Called when the activity is first created. */ @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); getWindow().setFormat(PixelFormat.RGBA_8888); getWindow().addFlags(WindowManager.LayoutParams.FLAG_DITHER); setContentView(R.layout.splashscreen); com.umeng.socialize.utils.Log.LOG = true; MobclickAgent.updateOnlineConfig(this); MobclickAgent.setOnlineConfigureListener( new UmengOnlineConfigureListener() { @Override public void onDataReceived(JSONObject data) {} }); LocationUtil mApplication = LocationUtil.getInstance(splashScreen.this); new Handler() .postDelayed( new Runnable() { public void run() { /* Create an Intent that will start the Main WordPress Activity. */ Intent mainIntent = new Intent(splashScreen.this, MainActivity.class); mainIntent.putExtra( "TEXT", splashScreen.this.getResources().getString(R.string.title_transparent_desc)); mainIntent.putExtra( AbConstant.TITLE_TRANSPARENT_FLAG, AbConstant.TITLE_TRANSPARENT); splashScreen.this.startActivity(mainIntent); splashScreen.this.finish(); } }, 2900); // 2900 for release }
@Override public void onCreate() { super.onCreate(); // if (isDexProcess()) { // return; // } if (BuildConfig.LOG_DEBUG) { LeakCanary.install(this); // BlockCanary.install(this, new NoteBlockCanaryContext(this)).start(); AndroidDevMetrics.initWith(this); } initComponent(); Utils.init(this); initImageLoader(); FilePathUtils.initEnvironment(this); // 打点 MobclickAgent.setDebugMode(BuildConfig.LOG_DEBUG); MobclickAgent.openActivityDurationTrack(true); MobclickAgent.updateOnlineConfig(this); MobclickAgent.setCatchUncaughtExceptions(!BuildConfig.LOG_DEBUG); // CrashHandler.getInstance().init(getApplicationContext()); YLog.setDEBUG(BuildConfig.LOG_DEBUG); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // new UpgradeManager(this).checkandupdate(); MobclickAgent.updateOnlineConfig(this); MobclickAgent.openActivityDurationTrack(false); initContentview(); initMenuview(); }
/** 友盟数据统计 */ private void initUmengStatistics() { MobclickAgent.setDebugMode(true); // SDK在统计Fragment时,需要关闭Activity自带的页面统计, // 然后在每个页面中重新集成页面统计的代码(包括调用了 onResume 和 onPause 的Activity)。 MobclickAgent.openActivityDurationTrack(false); // MobclickAgent.setAutoLocation(true); // MobclickAgent.setSessionContinueMillis(1000); MobclickAgent.updateOnlineConfig(this); }
/** * @param context * @param isDebug */ public static void init(Context context, boolean isDebug) { com.umeng.common.Log.LOG = isDebug; MobclickAgent.setDebugMode(isDebug); MobclickAgent.setAutoLocation(true); MobclickAgent.setSessionContinueMillis(1000); // MobclickAgent.setUpdateOnlyWifi(false); // MobclickAgent.setDefaultReportPolicy(context, // ReportPolicy.BATCH_BY_INTERVAL, 5*1000); MobclickAgent.updateOnlineConfig(context); MobclickAgent.onError(context); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); MobclickAgent.updateOnlineConfig(this); if (!isFirstBoot) { Intent intent = new Intent(this, SplashActivity.class); startActivity(intent); } else { startActivity(new Intent(this, UserHelperActivity.class)); } finish(); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_root); tabHost = (FragmentTabHost) findViewById(android.R.id.tabhost); tabHost.setup(this, getSupportFragmentManager(), R.id.realtabcontent); tabHost.addTab( tabHost .newTabSpec("manager") .setIndicator(createTabItem("课程管理", R.drawable.ic_tab_manager)), CourseManagerFragment.class, null); View groupTabItem = createTabItem("学生群组", R.drawable.ic_tab_group); groupDot = groupTabItem.findViewById(R.id.dot); tabHost.addTab( tabHost.newTabSpec("chatlist").setIndicator(groupTabItem), ChatListFragment.class, null); tabHost.addTab( tabHost .newTabSpec("material") .setIndicator(createTabItem("教材教具", R.drawable.ic_tab_material)), TeachMaterialFragment.class, null); View mineTabItem = createTabItem("我的", R.drawable.ic_tab_mine); mineDot = mineTabItem.findViewById(R.id.dot); tabHost.addTab(tabHost.newTabSpec("mine").setIndicator(mineTabItem), MineFragment.class, null); tabHost.setOnTabChangedListener(this); // Umeng MobclickAgent.updateOnlineConfig(this); UmengUpdateAgent.silentUpdate(this); // RongCloud doRCIMConnect(3); isFirstLogin = Boolean.valueOf(getIntent().getData().getQueryParameter("isFirstLogin")); if (isFirstLogin) { startActivity("sgteacher://applyteacher?fromLogin=true"); } RongIM.setOnReceiveMessageListener(this); setSwipeBackEnable(false); }
@Override public void onCreate() { super.onCreate(); mInstance = this; /** 初始化 */ AiYouManager.getInstance(this); NetWorkManager.getInstance(this); SwitchManager.getInstance(this); if (FileManager.checkSDCard()) { removeExpiredCache(); } else { Toast.makeText(getBaseContext(), "SD卡未安装或空间不足", Toast.LENGTH_SHORT).show(); } try { // 百度地图初始化 SDKInitializer.initialize(this); initEngineManager(this); } catch (Exception e) { Logcat.e(TAG, "百度地图初始化错误"); } /** 友盟推送 */ mPushAgent = PushAgent.getInstance(this); mPushAgent.setDebugMode(false); /** 友盟用户反馈 */ FeedbackPush.getInstance(this).init(false); /** 友盟自动更新 */ // 非wifi环境更新开启,要放在updata()之前调用 UmengUpdateAgent.setUpdateOnlyWifi(SwitchManager.getInstance(this).getUpdateOnlyWifi()); UmengUpdateAgent.update(this); /** 友盟在线参数—— 获取帖子尾巴 */ MobclickAgent.updateOnlineConfig(this); BBSManager.getInstance(this).setAppTail(MobclickAgent.getConfigParams(this, "app_tail")); // 获取iptv频道列表 IptvManager.getChanelList(); MapHelper.initMapDatas(this); initSections(); initFavorite(); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); isFirstRun = true; // MobclickAgent.setDebugMode(true); MobclickAgent.openActivityDurationTrack(false); MobclickAgent.updateOnlineConfig(this); Log.d("LiveWallpaperSettingsCfgActivity", "updateOnlineConfig"); setContentView(R.layout.setting); sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this); tvCustomWallpaper = (TextView) this.findViewById(R.id.tvCustomWallpaper); tvSysWallpaper = (TextView) this.findViewById(R.id.tvSysWallpaper); tvDefWallpaper = (TextView) this.findViewById(R.id.tvDefWallpaper); // tbScroll = (ToggleButton) this.findViewById(R.id.tbScroll); rgFrequency = (RadioGroup) this.findViewById(R.id.rgFrequency); rgRipplesSize = (RadioGroup) this.findViewById(R.id.rgRipplesSize); loadConfig(); // tbScroll.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { // // @Override // public void onCheckedChanged(CompoundButton buttonView, // boolean isChecked) { // LibgdxLiveWallpaperAndroidService.ripplesSettings.scrollbackground = tbScroll // .isChecked(); // Editor edit = sharedPreferences.edit(); // edit.putBoolean( // SCROLLBACKGROUND, // LibgdxLiveWallpaperAndroidService.ripplesSettings.scrollbackground); // edit.commit(); // } // }); rgFrequency.setOnCheckedChangeListener( new RadioGroup.OnCheckedChangeListener() { @Override public void onCheckedChanged(RadioGroup group, int checkedId) { switch (rgFrequency.getCheckedRadioButtonId()) { case R.id.rbClose: LibgdxLiveWallpaperAndroidService.ripplesSettings.frequency = "0"; break; case R.id.rbFast: LibgdxLiveWallpaperAndroidService.ripplesSettings.frequency = "1"; break; case R.id.rbNormal: LibgdxLiveWallpaperAndroidService.ripplesSettings.frequency = "2"; break; case R.id.rbSlow: LibgdxLiveWallpaperAndroidService.ripplesSettings.frequency = "3"; break; default: LibgdxLiveWallpaperAndroidService.ripplesSettings.frequency = "0"; break; } Editor edit = sharedPreferences.edit(); edit.putString(FREQUENCY, LibgdxLiveWallpaperAndroidService.ripplesSettings.frequency); edit.commit(); } }); rgRipplesSize.setOnCheckedChangeListener( new RadioGroup.OnCheckedChangeListener() { @Override public void onCheckedChanged(RadioGroup group, int checkedId) { switch (rgRipplesSize.getCheckedRadioButtonId()) { case R.id.rbRipplesBig: LibgdxLiveWallpaperAndroidService.ripplesSettings.range = "1"; break; case R.id.rbRipplesNormal: LibgdxLiveWallpaperAndroidService.ripplesSettings.range = "2"; break; case R.id.rbRipplesSmall: LibgdxLiveWallpaperAndroidService.ripplesSettings.range = "3"; break; default: LibgdxLiveWallpaperAndroidService.ripplesSettings.range = "2"; break; } Editor edit = sharedPreferences.edit(); edit.putString(RANGE, LibgdxLiveWallpaperAndroidService.ripplesSettings.range); edit.commit(); } }); // ImageView iv = (ImageView) this.findViewById(R.id.ivAd); // iv.setImageBitmap(AdvertService.getAdvertImage(this)); // iv.setOnClickListener(new OnClickListener() { // // @Override // public void onClick(View v) { // AdvertService.gotoUiCenter(LiveWallpaperSettingsCfgActivity.this); // } // }); tvCustomWallpaper.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(Intent.ACTION_GET_CONTENT); intent.setType("image/*"); startActivityForResult(intent, 0); } }); tvSysWallpaper.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { if (LibgdxLiveWallpaperAndroidService.ripplesSettings.currentWallpaper != 1) { Editor editor = sharedPreferences.edit(); editor.putInt("current_wallpaper", 1); LibgdxLiveWallpaperAndroidService.ripplesSettings.currentWallpaper = 1; Wallpaper.mFirstLoading = true; WallpaperManager wallpaperManager = WallpaperManager.getInstance(LiveWallpaperSettingsCfgActivity.this); Drawable drawable = wallpaperManager.getDrawable(); BitmapDrawable bitmapDrawable = (BitmapDrawable) drawable; Bitmap bitmap = bitmapDrawable.getBitmap(); LibgdxLiveWallpaperAndroidService.ripplesSettings.bitmap = bitmap; editor.commit(); } finish(); } }); tvDefWallpaper.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { if (LibgdxLiveWallpaperAndroidService.ripplesSettings.currentWallpaper != 0) { Editor editor = sharedPreferences.edit(); editor.putInt("current_wallpaper", 0); LibgdxLiveWallpaperAndroidService.ripplesSettings.currentWallpaper = 0; editor.commit(); Wallpaper.mFirstLoading = true; } finish(); } }); // adView = new AdView(this, AdSize.BANNER, "a153301b742b855"); // linearLayout = (LinearLayout) findViewById(R.id.LinearLayout); // linearLayout.addView(adView); // adView.loadAd(new AdRequest()); }
void init() { MobclickAgent.openActivityDurationTrack(false); MobclickAgent.setAutoLocation(true); MobclickAgent.updateOnlineConfig(mContext); }