[android-beginners] Re: How to receive callback when press and hold button for a longer time.

2009-10-02 Thread Alexander Kazanin
Hi. If I understood your intentions correctly you should set OnLongClickListener. Button button = (Button) findViewById(R.id.*channel_up*); button.setOnFocusChangeListener(new View.OnLongClickListener() { public boolean onLongClick(View vie

[android-beginners] Re: How to receive callback when press and hold button for a longer time.

2009-10-03 Thread Shude Zheng
Hi, Alexander, Thank you. I have not describe the question clearly. I want change the channel by pressing button. But press button once and the callback is called once. The channel only one channel up. But I want to change more channels. So I press the button and hold it. The callback will call a

[android-beginners] Re: How to receive callback when press and hold button for a longer time.

2009-10-04 Thread Alexander Kazanin
Now I see. I will suggest a following solution. Suppose we have an activity. Lets create a handler. Than add to our "channel up" button View.OnTouchListener. Each time user presses the button, we will increase channel number and send a message to handler with FIRST_DELAY delay time. And when user