From 9b3463c8e0ecf77758991002765c443d21debc28 Mon Sep 17 00:00:00 2001 From: Andy2 Date: Fri, 2 Jul 2010 06:25:10 -0700 Subject: [PATCH] use local OnClickListener rather than have Activity implement interface --- .../src/org/eehouse/android/xw4/GamesList.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GamesList.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GamesList.java index e58c3c070..4a97f55e0 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GamesList.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GamesList.java @@ -42,7 +42,7 @@ import junit.framework.Assert; import org.eehouse.android.xw4.jni.*; -public class GamesList extends ListActivity implements View.OnClickListener { +public class GamesList extends ListActivity { private static final int WARN_NODICT = Utils.DIALOG_LAST + 1; private static final int CONFIRM_DELETE_ALL = Utils.DIALOG_LAST + 2; @@ -117,7 +117,13 @@ public class GamesList extends ListActivity implements View.OnClickListener { registerForContextMenu( getListView() ); Button newGameB = (Button)findViewById(R.id.new_game); - newGameB.setOnClickListener( this ); + newGameB.setOnClickListener( new View.OnClickListener() { + @Override + public void onClick( View v ) { + saveNew( new CurGameInfo( GamesList.this ) ); + onContentChanged(); + } + } ); m_adapter = new GameListAdapter( this ); setListAdapter( m_adapter ); @@ -262,11 +268,6 @@ public class GamesList extends ListActivity implements View.OnClickListener { return handled; } - public void onClick( View v ) { - saveNew( new CurGameInfo( this ) ); - onContentChanged(); - } - @Override protected void onListItemClick(ListView l, View v, int position, long id) {