Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>after deleting an item, you need to call adapter's <code>notifyDataSetChanged()</code> method for refreshing the list contents</p> <p>fillData in your Activity Marks seems a little suspecious, i guess it should be as follow:</p> <pre><code>private void fillData() { Bundle extras = getIntent().getExtras(); String txt_sub_id = extras.getString("IDFach"); int test = Integer.parseInt(txt_sub_id); Cursor mCursor = db.rawQuery("SELECT _id, subid, name, mark, gewicht, datum FROM tbl_marks WHERE subid = '"+test+"';", null); startManagingCursor(mCursor); if (mCursor != null &amp;&amp; mCursor.moveToFirst()) { zahl1 = 0; zahl2 = 0; int intMark = mCursor.getColumnIndex("mark"); int intWeight = mCursor.getColumnIndex("gewicht"); do { float weight = mCursor.getFloat(intWeight); float mark = mCursor.getFloat(intMark); zahl1 = zahl1 + (weight * mark); zahl2 = zahl2 + weight; } while (mCursor.moveToNext()); mCursor.moveToFirst(); //bringing cursor to first place String[] from = new String[] { dbHelper.MARKS_ROW_NAME, dbHelper.MARKS_ROW_MARK, dbHelper.MARKS_ROW_GEWICHT, dbHelper.MARKS_ROW_DATUM}; int[] to = new int[] {R.id.txt_marks_row, R.id.txt_note, R.id.txt_gewicht, R.id.txt_datum}; SimpleCursorAdapter notes = new SimpleCursorAdapter(this, R.layout.show_marks, mCursor, from, to); setListAdapter(notes); txt_durchschnitt = (TextView)findViewById(R.id.txt_durchschnitt); result = zahl1 / zahl2; float result_neu = (float) (Math.round(result * 100) / 100.0); txt_durchschnitt.setText(""+result_neu); } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload