Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Add implements View.OnClickListener
- public class MainActivity extends AppCompatActivity implements View.OnClickListener {...}
- private void initInstances() {
- btn_calculate = (Button) findViewById(R.id.btn_calculate);
- btn_calculate.setOnClickListener(this); //Add this and Alt Enter choose Make '..Activity' implement '....'
- }
- @Override
- public void onClick(View v) {
- if (v == btn_calculate) {
- // Do something
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement