Esempio n. 1
0
  @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);
  }
Esempio n. 2
0
 @Override
 protected void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   //		new UpgradeManager(this).checkandupdate();
   MobclickAgent.updateOnlineConfig(this);
   MobclickAgent.openActivityDurationTrack(false);
   initContentview();
   initMenuview();
 }
Esempio n. 3
0
  /** 友盟数据统计 */
  private void initUmengStatistics() {
    MobclickAgent.setDebugMode(true);
    // SDK在统计Fragment时,需要关闭Activity自带的页面统计,
    // 然后在每个页面中重新集成页面统计的代码(包括调用了 onResume 和 onPause 的Activity)。
    MobclickAgent.openActivityDurationTrack(false);
    // MobclickAgent.setAutoLocation(true);
    // MobclickAgent.setSessionContinueMillis(1000);

    MobclickAgent.updateOnlineConfig(this);
  }
Esempio n. 4
0
 @Override
 public void onCreate() {
   super.onCreate();
   mApp = this;
   mService = new GlobalServiceMger(AppService.class);
   initImageLoader(getApplicationContext());
   MobclickAgent.openActivityDurationTrack(false);
   MobclickAgent.setDebugMode(false);
   UrlUtils.initUrlBase(ValConfig.URL_BASE_RELEASE, ValConfig.URL_BASE_DEBUG);
   mLocalBroadcast = new Receiver();
   mLocalBroadcast.toggleLocalBroadcast(this, true);
   boolean needUpdate = new InitHelper(this).initUpdate();
   d("onCreate", "update database before 3.0 is " + needUpdate);
 }
Esempio n. 5
0
 @Override
 public void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   requestWindowFeature(Window.FEATURE_NO_TITLE); // 去掉标题
   getWindow()
       .setFlags(
           WindowManager.LayoutParams.FLAG_FULLSCREEN,
           WindowManager.LayoutParams.FLAG_FULLSCREEN); // 全屏显示
   setContentView(R.layout.home_activity);
   MobclickAgent.onError(this); // 在总入口添加错误报告提交BY贺思明 2012-6-28
   MobclickAgent.openActivityDurationTrack(true); // 统计在线时长BY贺思明 2012-6-28
   shellRW = new RWSharedPreferences(this, ShellRWConstants.SHAREPREFERENCESNAME);
   initImgView(); // 开机图片
   getMachineInfo(); // 获取手机信息
   clearLastLoginInfo(); // 清空上次登录信息
   getChannel(); // 读取本地渠道号
   setPadding(); // 设置高频彩单选按钮间距
   initBitmap(); // 初始化小球
   checkWirelessNetwork(); // 实现网络的检测
 }
  @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);
	}
 @Override
 protected void pluginInitialize() {
   super.pluginInitialize();
   MobclickAgent.openActivityDurationTrack(false);
   Log.d(TAG, "umeng analytics plugin initialzed.");
 }