diff --git a/ExaltedDice/src/com/TwentyCode/android/ExaltedDice/ExaltedDice.java b/ExaltedDice/src/com/TwentyCode/android/ExaltedDice/ExaltedDice.java index 0c85291..abd67c2 100755 --- a/ExaltedDice/src/com/TwentyCode/android/ExaltedDice/ExaltedDice.java +++ b/ExaltedDice/src/com/TwentyCode/android/ExaltedDice/ExaltedDice.java @@ -70,15 +70,6 @@ public class ExaltedDice extends Activity implements OnClickListener, OnItemClic } } - /** - * clears the rollHistory List array and refreshes the listview - * @author ricky barrette - */ - private void clearHistory() { - mDb.clearHistory(mGameId); - refresh(); - } - /** * also implemented OnClickListener * @@ -219,7 +210,7 @@ public class ExaltedDice extends Activity implements OnClickListener, OnItemClic quitDialog(); return true; case MENU_CLEAR: - clearHistory(); + mDb.clearHistory(mGameId); return true; case SETTINGS: startActivity(new Intent(this, Settings.class).putExtras(getIntent().getExtras())); @@ -346,8 +337,13 @@ public class ExaltedDice extends Activity implements OnClickListener, OnItemClic * @author ricky barrette */ public void refresh(){ -// mListAdapter.notifyDataSetChanged(); - mListView.setAdapter(mListAdapter); + mListAdapter.notifyDataSetChanged(); + mListView.post(new Runnable(){ + @Override + public void run(){ + mListView.setAdapter(mListAdapter); + } + }); } /** @@ -482,8 +478,12 @@ public class ExaltedDice extends Activity implements OnClickListener, OnItemClic @Override public void onDeletionComplete() { - // do nothing - + this.runOnUiThread(new Runnable(){ + @Override + public void run(){ + refresh(); + } + }); } @Override