Removed Roll Thread

Until I can figure out how to avoid the IllegalStateException: The
content of the adapter has changed but ListView did not receive a
notification

Change-Id: I0d8314acdc5a7706479f30223d6097b096c717ff
Signed-off-by: Ricky Barrette <rickbarrette@gmail.com>
This commit is contained in:
2012-02-09 11:40:07 -05:00
parent e69aa492bd
commit 73b6ff3319

View File

@@ -338,12 +338,7 @@ public class ExaltedDice extends Activity implements OnClickListener, OnItemClic
*/ */
public void refresh(){ public void refresh(){
mListAdapter.notifyDataSetChanged(); mListAdapter.notifyDataSetChanged();
mListView.post(new Runnable(){ mListView.setSelection(mDb.getGameRollCount(mGameId));
@Override
public void run(){
mListView.setAdapter(mListAdapter);
}
});
} }
/** /**
@@ -387,12 +382,13 @@ public class ExaltedDice extends Activity implements OnClickListener, OnItemClic
* @author ricky barrette * @author ricky barrette
*/ */
public void rollDice() { public void rollDice() {
mListAdapter.notifyDataSetInvalidated();
mRollButton.setEnabled(false); mRollButton.setEnabled(false);
mRollProgress.setVisibility(View.VISIBLE); mRollProgress.setVisibility(View.VISIBLE);
new Thread( new Runnable() { // new Thread( new Runnable() {
@Override // @Override
public void run(){ // public void run(){
// vibrate for 50 milliseconds // vibrate for 50 milliseconds
vibrate(50); vibrate(50);
@@ -406,8 +402,8 @@ public class ExaltedDice extends Activity implements OnClickListener, OnItemClic
roll.put(Database.KEY_MOD, DatabaseUtils.sqlEscapeString(mModValues[mModPicker.getValue()])); roll.put(Database.KEY_MOD, DatabaseUtils.sqlEscapeString(mModValues[mModPicker.getValue()]));
mDb.updateGame(mGameId, mGameName, roll, rollId); mDb.updateGame(mGameId, mGameName, roll, rollId);
} // }
}).start(); // }).start();
} }
/** /**