/** * Called when user clicks an item in the list. Starts an activity to open the url for that item. */ @Override protected void onListItemClick(ListView l, View v, int position, long id) { // Wrokround since PullToRefreshView already has one item in this list. RssItem item = mAdapter.getItem(position - 1); // Creates and starts an intent to open the item.link url. Intent intent = new Intent(); intent.setClass(this, DetailActivity.class); intent.putExtra("data", item.getDescription()); startActivity(intent); }
private void addDataFromDB() { // mAdapter.add(new RssItem()); Cursor cursor = getContentResolver().query(RSSApp.RssItems.CONTENT_URI, PROJECTION, null, null, null); if (cursor != null && cursor.getCount() != 0) { while (cursor.moveToNext()) { RssItem item = new RssItem(cursor.getString(1), null, cursor.getString(2), cursor.getString(3)); mAdapter.add(item); } } }