use local OnClickListener rather than have Activity implement interface

This commit is contained in:
Andy2 2010-07-02 06:25:10 -07:00
parent 3b9240ca84
commit 9b3463c8e0

View file

@ -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)
{