0

I'm trying to make this work:

        ControlView btnClearCounter = mLayout.findViewById(R.id.btn_clear);
        btnClearCounter.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick() {
                mCounter=mCounter-1;
                updatePressedText();
            }
        });

        btnClearCounter.setOnLongClickListener(new OnLongClickListener() {
            @Override
            public void onLongClick() {
                mCounter=0;
                updatePressedText();
            }
        });

Can't get the onLongClick to fire.

How to do that?

JasonMArcher
  • 14,195
  • 22
  • 56
  • 52
Kokesh
  • 3,165
  • 7
  • 29
  • 46
  • May the comments of this answer help you. http://stackoverflow.com/questions/22616429/sony-smart-watch-2-how-to-prevent-click-type-short-from-being-called-after-butt – Apurva Feb 21 '15 at 16:22
  • I've read them yesterday, but it didn't help me. – Kokesh Feb 22 '15 at 11:59

1 Answers1

0

I think that you may be better of overriding the onTouch handler in this instance. There is an example of this in the HelloLayouts sample. Here is the code:

@Override
public void onTouch(ControlTouchEvent event) {
    super.onTouch(event);

    if (event.getAction() == Control.Intents.TOUCH_ACTION_LONGPRESS) {
        Log.d(TAG, "Long press received");
    }


}
pg316
  • 1,380
  • 1
  • 8
  • 7