Пример #1
0
 private void getAccountInfo() {
   SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(this);
   String id = sharedPref.getString("id", "");
   if (!TextUtils.isEmpty(id)) {
     accountBean = DatabaseManager.getInstance().getAccount(id);
     if (accountBean != null) {
       token = accountBean.getAccess_token();
       getActionBar().setSubtitle(accountBean.getUsernick());
     } else {
       List<AccountBean> accountList = DatabaseManager.getInstance().getAccountList();
       if (accountList != null && accountList.size() > 0) {
         AccountBean account = accountList.get(0);
         accountBean = account;
         token = account.getAccess_token();
         getActionBar().setSubtitle(account.getUsernick());
       }
     }
   }
 }
Пример #2
0
 protected Loader<AsyncTaskLoaderResult<MessageListBean>> onCreateOldMsgLoader(
     int id, Bundle args) {
   String accountId = accountBean.getUid();
   String token = accountBean.getAccess_token();
   String maxId = null;
   if (getList().getItemList().size() > 0) {
     maxId = getList().getItemList().get(getList().getItemList().size() - 1).getId();
   }
   return new FriendsMsgLoader(getActivity(), accountId, token, currentGroupId, null, maxId);
 }
Пример #3
0
 protected Loader<AsyncTaskLoaderResult<MessageListBean>> onCreateMiddleMsgLoader(
     int id,
     Bundle args,
     String middleBeginId,
     String middleEndId,
     String middleEndTag,
     int middlePosition) {
   String accountId = accountBean.getUid();
   String token = accountBean.getAccess_token();
   return new FriendsMsgLoader(
       getActivity(), accountId, token, currentGroupId, middleBeginId, middleEndId);
 }
Пример #4
0
 public String getToken() {
   return accountBean.getAccess_token();
 }