コード例 #1
0
  public void listPostForCurrentMemberService() {
    if (GeneralHelpers.isInternetAvailable(getActivity())) {
      if (GlobalVariables.isCurrentMember == true) {
        // spinner.setVisibility(View.VISIBLE);
        PostService postService = new PostService(accessToken);
        postService.listPostsForMe();
        loading.setVisibility(View.VISIBLE);
      } else {

        // spinner.setVisibility(View.VISIBLE);
        SharedPreferences preferences =
            getActivity().getSharedPreferences("CurrentUser", getActivity().MODE_PRIVATE);
        Member member =
            Member.createUserFromJson(
                createJsonElementFromString(preferences.getString("profile_member", "")));
        PostService postService = new PostService(accessToken);
        postService.listPostsForMember(member.id);
        loading.setVisibility(View.VISIBLE);
      }
    } else {
      // ViewHelpers.showProgress(false, this, contentFrame, membersSearchProgress);
      ViewHelpers.showPopup(
          getActivity(),
          getResources().getString(R.string.alert_title_network),
          getResources().getString(R.string.no_connection),
          true);
    }
  }
コード例 #2
0
  @Override
  public View onCreateView(
      LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

    getActivity().invalidateOptionsMenu();
    getActivity().getActionBar().setTitle("To do");
    BaseApplication.register(this);
    layoutInflater = inflater;
    preferences = getActivity().getSharedPreferences("CurrentUser", getActivity().MODE_PRIVATE);
    currentMember =
        Member.createUserFromJson(
            createJsonElementFromString(preferences.getString("current_member", "")));
    GlobalVariables.menuDeep = 1;
    getActivity().onPrepareOptionsMenu(GlobalVariables.menu);
    return null;
  }
コード例 #3
0
  @Override
  public View onCreateView(
      LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    BaseApplication.register(this);

    SharedPreferences preferences =
        getActivity().getSharedPreferences("CurrentUser", getActivity().MODE_PRIVATE);
    currentUser =
        Member.createUserFromJson(
            createJsonElementFromString(preferences.getString("current_member", "")));
    accessToken = preferences.getString("access_token", "").replace("\"", "");

    PostsAdapter.lastClickedPosts = new ArrayList<Integer>();

    this.inflater = inflater;

    return null;
  }
コード例 #4
0
ファイル: OneHubFragment.java プロジェクト: cmoissam/cafe_AMI
  @Override
  public View onCreateView(
      LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    this.inflater = inflater;

    if (getArguments() != null)
      hubToDisplay = (Hub) getArguments().getSerializable(NEW_INSTANCE_HUB_KEY);

    SharedPreferences preferences =
        getActivity().getSharedPreferences("CurrentUser", getActivity().MODE_PRIVATE);
    currentMember =
        Member.createUserFromJson(
            createJsonElementFromString(preferences.getString("current_member", "")));
    accessToken = preferences.getString("access_token", "").replace("\"", "");
    GlobalVariables.menuDeep = 1;
    getActivity().onPrepareOptionsMenu(GlobalVariables.menu);
    BaseApplication.register(this);
    return null;
  }