Skip to content Skip to sidebar Skip to footer

Cursorboundexception Whille Displaying Listview From Content Provider

somebody pls get me out of this.I am trying to display a list from an sqlite database which worked absolutely fine but dont know what went wrong it showed cant find provider info.I

Solution 1:

Try this solution

 @Override
    @TargetApi(15)
    public View getView(int position, View convertView, ViewGroup parent) {
        View row = convertView;
        if (row == null) {
            row = mActivity.getLayoutInflater().inflate(mLayoutId, null, false);
        }
            Cursor list_cursor = getCursor();
            list_cursor.moveToPosition(position);

            if(!list_cursor.isLast()){

                 list_cursor.moveToNext();
                 TextView txtSecondCell = (TextView) row.findViewById(R.id.recname_row);
                 String recipename = list_cursor.getString(list_cursor.getColumnIndex(Recipe.NAME_NIC));
                 txtSecondCell.setText(recipename);
                 Log.i(TAG, "Showing List");
            }
        return row;
   }

Post a Comment for "Cursorboundexception Whille Displaying Listview From Content Provider"