コード例 #1
0
  public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    mQueryHandler = new AsyncQueryHandler(getActivity().getContentResolver()) {};
    code = getArguments().getString(ProfileActivity.PROFILE_CODE);
    if (code == null) code = AccountUtils.getActiveUserCode(getActivity());

    // You can't friend yourself
    if (code.equals(AccountUtils.getActiveUserCode(getActivity()))) friend.setVisibility(View.GONE);
    else
      getActivity().getSupportLoaderManager().initLoader(FRIEND_LOADER, null, new FriendChecker());
    getActivity().getSupportLoaderManager().initLoader(PROFILE_LOADER, null, this);
  }
コード例 #2
0
 @Override
 protected void onRepeat() {
   super.onRepeat();
   setRefreshActionItemState(true);
   SigarraSyncAdapterUtils.syncProfile(
       AccountUtils.getActiveUserName(getActivity()), code, SifeupAPI.EMPLOYEE_TYPE);
 }
コード例 #3
0
 public boolean onOptionsItemSelected(MenuItem item) {
   if (item.getItemId() == R.id.menu_refresh) {
     setRefreshActionItemState(true);
     SigarraSyncAdapterUtils.syncProfile(
         AccountUtils.getActiveUserName(getActivity()), code, SifeupAPI.EMPLOYEE_TYPE);
     return true;
   }
   return super.onOptionsItemSelected(item);
 }
コード例 #4
0
 @Override
 public Loader<Cursor> onCreateLoader(int loaderId, Bundle options) {
   return new CursorLoader(
       getActivity(),
       SigarraContract.Friends.CONTENT_URI,
       SigarraContract.Friends.FRIENDS_COLUMNS,
       SigarraContract.Friends.FRIEND_SELECTION,
       SigarraContract.Friends.getFriendSelectionArgs(
           AccountUtils.getActiveUserCode(getActivity()), code),
       null);
 }
コード例 #5
0
 @Override
 public void onActivityCreated(Bundle savedInstanceState) {
   super.onActivityCreated(savedInstanceState);
   personCode = getArguments().getString(PROFILE_CODE);
   if (personCode == null) personCode = AccountUtils.getActiveUserCode(getActivity());
   if (savedInstanceState != null) {
     final Parcelable[] storedFiles = savedInstanceState.getParcelableArray(FILES_KEY);
     if (storedFiles == null) {
       task = DynamicEmailUtils.getDynamicEmailFiles(personCode, this, getActivity());
     } else {
       files = new DynamicMailFile[storedFiles.length];
       for (int i = 0; i < storedFiles.length; ++i) files[i] = (DynamicMailFile) storedFiles[i];
       if (populateList()) showMainScreen();
     }
   } else task = DynamicEmailUtils.getDynamicEmailFiles(personCode, this, getActivity());
 }