Beispiel #1
0
 @Override
 public void onCreate() {
   // TODO Auto-generated method stub
   super.onCreate();
   FrontiaApplication.initFrontiaApplication(getApplicationContext());
   mApp = this;
   initialize();
   CrashHandler catchHandler = CrashHandler.getInstance();
   catchHandler.init(getApplicationContext());
   initImageLoader(getApplicationContext());
 }
Beispiel #2
0
 @Override
 public void onCreate() {
   super.onCreate();
   _context = getApplicationContext();
   initEMChat();
   EMChat.getInstance().init(_context);
   EMChat.getInstance().setDebugMode(true);
   EMChat.getInstance().setAutoLogin(true);
   EMChatManager.getInstance().getChatOptions().setUseRoster(true);
   FrontiaApplication.initFrontiaApplication(this);
   // CrashHandler crashHandler = CrashHandler.getInstance();// 全局异常捕捉
   // crashHandler.init(_context);
 }
  /** the entrance for the application */
  @Override
  public void onCreate() {
    // TODO Auto-generated method stub
    super.onCreate();
    context = this;

    // Baidu Push Service
    FrontiaApplication.initFrontiaApplication(context);

    mBaiduPushServer = new BaiduPush(BaiduPush.HTTP_METHOD_POST, SECRIT_KEY, API_KEY);

    // 不转换没有 @Expose 注解的字段
    mGson = new GsonBuilder().excludeFieldsWithoutExposeAnnotation().create();

    mSpUtil = new SharedPreferencesUtil(this, SP_FILE_NAME);
    mUserDB = new UserDB(this);
    mMsgDB = new MsgDB(this);
    mConvDB = new ConvDB(this);
    mUserList = mUserDB.getAll();
    mMediaPlayer = MediaPlayer.create(this, R.raw.office);
    mNotificationManager =
        (NotificationManager) getSystemService(android.content.Context.NOTIFICATION_SERVICE);

    loadUserBaseData();

    activityManager = ActivityManager.getActivityManager(this); // 实例化活动管理类
    dbOperation = new MailDB(this);
    UID_SET = dbOperation.loadUIDSet("inbox");

    //		// Start Notification Service
    //		startNotificationService();
  }
Beispiel #4
0
 @Override
 public void onLowMemory() {
   super.onLowMemory();
   try {
     deleteCacheDirFile(getHJYCacheDir(), true);
   } catch (IOException e) {
     e.printStackTrace();
   }
   System.gc();
 }