Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- btn_other.setOnClickListener(this);
- <Button ...
- android:id="+@id/landButton
- android:onClick = "onClick"/>
- public void onClick(View view){
- switch (view.getId()){
- case R.id.landButton: //нажали на кнопку landButtin;
- break;
- }
- }
- Button landButton = (Button) findViewById(R.id.landButton);
- if (landButton != null) {
- // действия с кнопкой
- }
- @OnClick(R.id.myButton)
- public void onClickMyButton(View view) {
- //blah-blah
- }
- @Optional
- @OnClick(R.id.myButton)
- public void onClickMyButton(View view) {
- //blah-blah
- }
Add Comment
Please, Sign In to add comment