Using java Syntax Highlighting
- package com.pokereuphoria.odds;
- import android.content.Context;
- import android.util.AttributeSet;
- import android.widget.Button;
- import android.view.View;
- public class PokerButton extends Button implements View.OnClickListener {
- public PokerButton(Context context, AttributeSet attrs, int defStyle){
- super(context, attrs, defStyle);
- }
- public PokerButton(Context context, AttributeSet attrs){
- super(context, attrs);
- }
- public PokerButton(Context context){
- super(context);
- }
- public void onClick(View v){
- this.setBackgroundDrawable(null);
- }
- }
Parsed in 0.033 seconds, using GeSHi 1.0.8.4
Here is my main activity:
Using java Syntax Highlighting
- package com.pokereuphoria.odds;
- import android.app.Activity;
- import android.os.Bundle;
- import android.view.*;
- import android.widget.TextView;
- public class PokerOdds extends Activity {
- private static final int HOLDEM_ID = Menu.FIRST;
- private static final int OMAHA_ID = Menu.FIRST + 1;
- private static final int O8_ID = Menu.FIRST + 2;
- private static final int STUD_ID = Menu.FIRST + 3;
- private static final int STUD8_ID = Menu.FIRST + 4;
- /** Called when the activity is first created. */
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.main);
- }
- }
Parsed in 0.033 seconds, using GeSHi 1.0.8.4
For some reason, when I click on the PokerButton object, it does nothing. Of course, I have it setBackgroundDrawable(null) just for testing purposes. I originally tried it as v.setBackgroundDrawable(null) and that had no effect either. The main reason I am trying to do it like this is because I do not want to set separate onClickListeners for all 72+ buttons. Any help will be greatly appreciated.


