Android – Detect End of Long Press

I think your best bet is to use a combination of the onLongClickListener() and onTouchListener() for that button. You’ll need to catch certain events on the touch listener since it will trigger for every touch event. Try something like the following: class Blah extends Activity { private Button mSpeak; private boolean isSpeakButtonLongPressed = false; @Override … Read more

Disable the touch events for all the views

Here is a function for disabling all child views of some view group: /** * Enables/Disables all child views in a view group. * * @param viewGroup the view group * @param enabled <code>true</code> to enable, <code>false</code> to disable * the views. */ public static void enableDisableViewGroup(ViewGroup viewGroup, boolean enabled) { int childCount = viewGroup.getChildCount(); … Read more

Use a custom contextual action bar for WebView text selection

THERE IS AN EASIER WAY! See update below 😀 For the sake of completeness, here is how I fixed the problem: I followed the suggestion according to this answer, with a little more tweaking to more closely match the overridden code: public class MyWebView extends WebView { private ActionMode mActionMode; private mActionMode.Callback mActionModeCallback; @Override public … Read more

tech