سؤال

Is there an opportunity to implement an element that is able to get pressed longer then 30 sec until the MotionEvent Action_up timeout gets automatically fired?

Maybe an other concept of doing that job?

At the moment i have changed the image of an ImageButton by using the onTouchListener and the action_up and action_down define. But this concept is getting ruined by the auto action_up from android.

Edit: The problem could be caused by samsungs android mod. It occurs on the Galaxy Tab2 7.0 Wifionly edition but not on the HTC Sensation XE. Does anyone got an Galaxy Tab2 to cross check this behavior?

هل كانت مفيدة؟

المحلول 2

I tested this issue on other samsung tablets. The result is that there is no problem at all. Just the Tablet i am using Samsung Galaxy Tab 2 WiFi 7.0 (P3110) got that issue.

نصائح أخرى

Try this code for your solution i suppose this will help you.

@Override
public boolean onKeyLongPress(int keyCode, KeyEvent event) {
    if (keyCode == KeyEvent.KEYCODE_CALL) {
        // a long press of the call key.
        // do our work, returning true to consume it.  by
        // returning true, the framework knows an action has
        // been performed on the long press, so will set the
        // canceled flag for the following up event.
        return true;
    }
    return super.onKeyLongPress(keyCode, event);
}

The following Link will lead you to the correct result with other uses of Hard Keys.The link is as follows:-Imp Link

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top