Beispiel #1
0
  /** Sets the bread crumb. */
  protected void setBreadCrumb() {
    BreadCrumbHolder[] breadCrumbHolders = new BreadCrumbHolder[3];

    // common data
    HashMap<String, String> data = new HashMap<String, String>();
    data.put(Constants.User.USER_LOGIN, mUserLogin);
    data.put(Constants.Repository.REPO_NAME, mRepoName);

    // User
    BreadCrumbHolder b = new BreadCrumbHolder();
    b.setLabel(mUserLogin);
    b.setTag(Constants.User.USER_LOGIN);
    b.setData(data);
    breadCrumbHolders[0] = b;

    // Repo
    b = new BreadCrumbHolder();
    b.setLabel(mRepoName);
    b.setTag(Constants.Repository.REPO_NAME);
    b.setData(data);
    breadCrumbHolders[1] = b;

    // Issues
    b = new BreadCrumbHolder();
    b.setLabel("Issues");
    b.setTag(Constants.Issue.ISSUES);
    b.setData(data);
    breadCrumbHolders[2] = b;

    createBreadcrumb("Create Issue", breadCrumbHolders);
  }
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.generic_list);

    setUpActionBar();
    mUserLogin = getIntent().getStringExtra(Constants.User.USER_LOGIN);

    BreadCrumbHolder[] breadCrumbHolders = new BreadCrumbHolder[1];

    // common data
    HashMap<String, String> data = new HashMap<String, String>();
    data.put(Constants.User.USER_LOGIN, mUserLogin);

    // User
    BreadCrumbHolder b = new BreadCrumbHolder();
    b.setLabel(mUserLogin);
    b.setTag(Constants.User.USER_LOGIN);
    b.setData(data);
    breadCrumbHolders[0] = b;

    createBreadcrumb(getResources().getString(R.string.user_organizations), breadCrumbHolders);

    ListView mListView = (ListView) findViewById(R.id.list_view);
    mListView.setOnItemClickListener(
        new OnItemClickListener() {

          @Override
          public void onItemClick(AdapterView<?> adapterView, View view, int position, long id) {
            String organizationLogin = (String) adapterView.getAdapter().getItem(position);
            getApplicationContext()
                .openUserInfoActivity(OrganizationListActivity.this, organizationLogin, null);
          }
        });
    mAdapter = new SimpleStringAdapter(this, new ArrayList<String>());
    mListView.setAdapter(mAdapter);

    new LoadOrganizationsTask(this).execute();
  }