tags:

views:

22

answers:

0

I have been struggling with this one for a while now. My goal is to create a button that, when pushed generates the same result as when the down button on the DPAD is pressed. I created an onClick listener to accomplish this task.

downButton.setOnClickListener(new View.OnClickListener() {

            public void onClick(View v) {
                sendDownUpKeyEvents(KeyEvent.KEYCODE_DPAD_DOWN);
            }

        });

However this does not work... i get two errors in eclipse saying:

  • Cannot make a static reference to the non-static method sendDownUpKeyEvents(int) from the type InputMethodService
    • The method sendDownUpKeyEvents(int) is undefined for the type new View.OnClickListener(){}

Can anyone point me to the proper way of accomplishing this task??

All the tutorials that I have found on the topic are outdated.