Пример #1
0
  @Override
  public View getView(int position, View convertView, ViewGroup parent) {
    View row = convertView;
    RowHolder holder = null;

    if (row == null) {
      LayoutInflater inflater = ((Activity) activity).getLayoutInflater();
      row = inflater.inflate(layoutResourceId, parent, false);

      holder = new RowHolder();
      holder.imgIcon = (ImageView) row.findViewById(R.id.imgIcon);
      holder.txtTitle = (TextView) row.findViewById(R.id.txtTitle);
      holder.imgIcon.setOnClickListener(
          new BookmarkListener(row, data, position, activity, this.listfragment));

      row.setTag(holder);
    } else {
      holder = (RowHolder) row.getTag();
    }

    ParsedRow rowItem = data.get(position);
    holder.txtTitle.setText(rowItem.getTitle());
    holder.imgIcon.setImageResource(rowItem.getIcon());

    return row;
  }
Пример #2
0
  @Override
  public void onListItemClick(ListView parent, View v, int position, long id) {
    //	        Toast.makeText(this, this.currentEntries.get(position).getView(),
    // Toast.LENGTH_SHORT).show();
    ParsedRow clickedRow = EmpsiAdapter.currentData.get(position);
    int view = Integer.parseInt(clickedRow.getView());
    String title = clickedRow.getTitle();
    String scroll = clickedRow.getScroll();

    FileList fl = new FileList();
    String url = fl.getURL(view);

    Intent i = new Intent(getActivity(), MainActivity.class);

    i.putExtra("view", url);
    i.putExtra("title", title);
    i.putExtra("scroll", scroll);
    i.setData(Uri.parse(url));

    Log.d(TAG, "INTENT: " + title);
    Log.d(TAG, "INTENT: " + url);
    Log.d(TAG, "INTENT: " + scroll);

    //	        Toast.makeText(this, url, Toast.LENGTH_SHORT).show();

    startActivity(i);
  }