Does anyone have a job to set this up? Then user can edit the value - where I want to capture a long click event, either onLongClickListener, or for individual items OnItemLongClickListener I have a spinner in my verb bar.
I have read that the spinner does not support long clicks, but I was hoping that something could have changed / someone could have an alternative solution.
The ideal solution for editing strings is there - there is not a dedicated button for editing enough space in the action bar, and try to keep them long pressed for those intuitive edits
. Here are some related questions (though quite old now):
enable you to "simulate" One should click long with the following code:
Last handler action handler = new handler (); Last Runnable runnable = New Runnable () {@Override Public Zero Run () {Toast.makeText (activity.This, "long clicked", Toast.LENGTH_SHORT) .show (); }}; Spinner.setOnTouchListener (New View.OnTouchListener) {@Override Public Boolean onTouch (see V, MotionEvent event) {if (event.getAction () == MotionEvent.ACTION_DOWN} {actionHandler.postDelayed (runnable, 1000);} else if (Event.getAction () == MotionEvent.ACTION_UP) {actionHandler.remove callback (return);} return false;}});
They can play around to feel "real" for a long time, but this is my very belief.
I hope this helps
>
No comments:
Post a Comment