Created
June 18, 2014 01:16
-
-
Save Seth-Johnson/af01f21c51d7ad6ff90b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class TempConverterMain extends Activity { | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_temp_converter_main); | |
// I'd prefer not to have to declare these twice, so I can use them in my subclass below | |
Button convertToFButton = (Button) findViewById(R.id.convertToF); | |
Button convertToCButton = (Button) findViewById(R.id.convertToC); | |
convertToFButton.setOnClickListener(new myButtonListener()); | |
convertToCButton.setOnClickListener(new myButtonListener()); | |
} | |
class myButtonListener implements View.OnClickListener { | |
Button convertToFButton = (Button) findViewById(R.id.convertToF); | |
Button convertToCButton = (Button) findViewById(R.id.convertToC); | |
// more code | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment