mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-03 23:04:08 +01:00
a bit of cleanup: inval rather than replace
This commit is contained in:
parent
81e3578dd5
commit
58d29fbb26
1 changed files with 3 additions and 5 deletions
|
@ -302,18 +302,16 @@ public class GamesList extends XWListActivity
|
||||||
|
|
||||||
switch (item.getItemId()) {
|
switch (item.getItemId()) {
|
||||||
case R.id.gamel_menu_delete_all:
|
case R.id.gamel_menu_delete_all:
|
||||||
if ( DBUtils.gamesList( this ).length > 0 ) {
|
final String[] games = DBUtils.gamesList( this );
|
||||||
|
if ( games.length > 0 ) {
|
||||||
DialogInterface.OnClickListener lstnr =
|
DialogInterface.OnClickListener lstnr =
|
||||||
new DialogInterface.OnClickListener() {
|
new DialogInterface.OnClickListener() {
|
||||||
public void onClick( DialogInterface dlg, int item ) {
|
public void onClick( DialogInterface dlg, int item ) {
|
||||||
String[] games =
|
|
||||||
DBUtils.gamesList( GamesList.this );
|
|
||||||
for ( int ii = games.length - 1; ii >= 0; --ii ) {
|
for ( int ii = games.length - 1; ii >= 0; --ii ) {
|
||||||
GameUtils.deleteGame( GamesList.this, games[ii],
|
GameUtils.deleteGame( GamesList.this, games[ii],
|
||||||
ii == 0 );
|
ii == 0 );
|
||||||
|
m_adapter.inval( games[ii] );
|
||||||
}
|
}
|
||||||
m_adapter = new GameListAdapter( GamesList.this );
|
|
||||||
setListAdapter( m_adapter );
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
showConfirmThen( R.string.confirm_delete_all, lstnr );
|
showConfirmThen( R.string.confirm_delete_all, lstnr );
|
||||||
|
|
Loading…
Reference in a new issue