示例#1
0
  private void initData() {
    this.initUserData();
    // this.initChatContent();
    mBaiduPushServer = new BaiduPush(BaiduPush.HTTP_METHOD_POST, SECRIT_KEY, API_KEY);
    // ²»×ª»»Ã»ÓÐ @Expose ×¢½âµÄ×Ö¶Î
    mGson = new GsonBuilder().excludeFieldsWithoutExposeAnnotation().create();
    mSpUtil = new SharePreferenceUtil(this, SP_FILE_NAME);
    mUserDB = new UserDB(this);
    mMsgDB = new MessageDB(this);
    mRecentDB = new RecentDB(this);

    mMediaPlayer = MediaPlayer.create(this, R.raw.office);
    mNotificationManager =
        (NotificationManager) getSystemService(android.content.Context.NOTIFICATION_SERVICE);

    if (mSpUtil.getId() == 0) {
      PushMessageReceiver.ehList.add(this); // ¼àÌýÍÆË͵ÄÏûÏ¢
      index = 1; // ÀÏʦ
      initFriend();
      User user = getCurrentUser();
      mSpUtil.setId(user.getId());
      mSpUtil.setRole(user.getRole());
      mSpUtil.setHeadIcon(user.getHeadIcon());
      mSpUtil.setNick(user.getNick());
      // mSpUtil.setTag(SexAdapter.SEXS[mSexWheel.getCurrentItem()]);

    }
    if (TextUtils.isEmpty(mSpUtil.getUserId()))
      PushManager.startWork(
          getApplicationContext(), PushConstants.LOGIN_TYPE_API_KEY, PushApplication.API_KEY);
    int id = mSpUtil.getId();
    int role = mSpUtil.getRole();
    String userId = mSpUtil.getUserId();
    String name = mSpUtil.getNick();
    String channelId = mSpUtil.getChannelId();
    mUserList = mUserDB.getUser();
  }
示例#2
0
  void initUserData() {
    this.m_userList = new ArrayList<User>();
    User user1 = new User();
    user1.setId(1);
    user1.setNick("aÀîÀÏʦ");
    user1.setRole(0);
    user1.setHeadIcon(0);
    user1.setUserId("954515449122882861");
    user1.setPhoneNum("13416111872");
    m_userList.add(user1);

    User user2 = new User();
    user2.setId(2);
    user2.setNick("aСÃ÷¼Ò³¤");
    user2.setRole(1);
    user2.setUserId("701586223983023931");
    user2.setHeadIcon(1);
    user2.setPhoneNum("13660606574");
    m_userList.add(user2);

    User user3 = new User();
    user3.setId(3);
    user3.setNick("aСºì¼Ò³¤");
    user3.setUserId("828868000250887501");
    user3.setRole(1);
    user3.setHeadIcon(1);
    user3.setPhoneNum("15819095037");
    m_userList.add(user3);
  }