Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class OnClickConverter implements View.OnFocusChangeListener {
- Runnable onClickAction;
- public OnClickConverter(Runnable onClickAction) {
- this.onClickAction = onClickAction;
- }
- @Override
- public void onFocusChange(View v, boolean hasFocus) {
- if (hasFocus) {
- Button buttonConvertSpeed = (Button) rootView.findViewById(R.id.buttonConvertSpeed);
- buttonConvertSpeed.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- onClickAction.run();
- }
- });
- }
- }
- }
- ...
- editKnot.setOnFocusChangeListener(new OnClickConverter(new Runnable() {
- @Override
- public void run() {
- // Custom logic goes here.
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement