@Override
 protected void onRepeat() {
   super.onRepeat();
   setRefreshActionItemState(true);
   SigarraSyncAdapterUtils.syncProfile(
       AccountUtils.getActiveUserName(getActivity()), code, SifeupAPI.EMPLOYEE_TYPE);
 }
  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);
  }
  @Override
  public View onCreateView(
      LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    super.onCreateView(inflater, container, savedInstanceState);
    ViewGroup root = (ViewGroup) inflateMainScreen(R.layout.profile);
    name = ((TextView) root.findViewById(R.id.profile_name));
    pic = (ImageView) root.findViewById(R.id.profile_pic);
    details = ((ListView) root.findViewById(R.id.profile_details));
    friend = ((CheckBox) root.findViewById(R.id.profile_star_friend));
    friend.setOnClickListener(
        new OnClickListener() {

          @Override
          public void onClick(View v) {
            if (friend.isChecked()) {
              final ContentValues values = new ContentValues();
              values.put(SigarraContract.FriendsColumns.CODE_FRIEND, me.getCode());
              values.put(SigarraContract.FriendsColumns.NAME_FRIEND, me.getName());
              values.put(SigarraContract.FriendsColumns.TYPE_FRIEND, me.getType());
              values.put(
                  SigarraContract.FriendsColumns.USER_CODE,
                  AccountUtils.getActiveUserCode(getActivity()));
              mQueryHandler.startInsert(0, null, SigarraContract.Friends.CONTENT_URI, values);
            } else
              mQueryHandler.startDelete(
                  0,
                  null,
                  SigarraContract.Friends.CONTENT_URI,
                  SigarraContract.Friends.FRIEND_SELECTION,
                  SigarraContract.Friends.getFriendSelectionArgs(
                      AccountUtils.getActiveUserCode(getActivity()), me.getCode()));
          }
        });
    ((Button) root.findViewById(R.id.profile_link_schedule))
        .setOnClickListener(
            new OnClickListener() {

              @Override
              public void onClick(View v) {
                Intent i = new Intent(getActivity(), ScheduleActivity.class);
                i.putExtra(ScheduleFragment.SCHEDULE_TYPE, ScheduleFragment.SCHEDULE_EMPLOYEE);
                i.putExtra(ScheduleFragment.SCHEDULE_CODE, me.getCode());
                i.putExtra(
                    Intent.EXTRA_TITLE, getString(R.string.title_schedule_arg, me.getName()));
                startActivity(i);
              }
            });
    return getParentContainer();
  }
 @Override
 public void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   setHasOptionsMenu(true);
   EasyTracker.getTracker().trackView("Employee Profile");
 }
 public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
   inflater.inflate(R.menu.refresh_menu_items, menu);
   super.onCreateOptionsMenu(menu, inflater);
 }