コード例 #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
 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);
 }
コード例 #3
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());
 }