Android onCreateContextMenu Fatal Exception by longclick on ListView item

Issue I try to create Context Menu for my List View, but when i do “long-click” on List item, application shut down with this trace: FATAL EXCEPTION: main java.lang.NullPointerException at com.android.internal.policy.impl.PhoneWindow$DecorView$ActionModeCallbackWrapper.onCreateActionMode(PhoneWindow.java:2445) at com.android.internal.app.ActionBarImpl$ActionModeImpl.dispatchOnCreate(ActionBarImpl.java:708) at com.android.internal.app.ActionBarImpl.startActionMode(ActionBarImpl.java:392) at android.app.Activity.onWindowStartingActionMode(Activity.java:4380) at com.android.internal.policy.impl.PhoneWindow$DecorView.startActionMode(PhoneWindow.java:2151) at

Continue reading

Set long click listener for listview

Issue I have below codes: public class MainActivity extends ListActivity { protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } protected void onListItemClick(ListView l, View v, final int position, long id) { super.onListItemClick(l, v, position, id); }} I need to change

Continue reading

Android long press with scroll

Issue I want to “connect” long press with scroll, so the user doesn’t have to release the screen and start to scroll. I have gesture detector implemented… final GestureDetector gestureDetector = new GestureDetector(new GestureDetector.SimpleOnGestureListener() { public void onLongPress(MotionEvent e) {

Continue reading

Android long press with scroll

Issue I want to “connect” long press with scroll, so the user doesn’t have to release the screen and start to scroll. I have gesture detector implemented… final GestureDetector gestureDetector = new GestureDetector(new GestureDetector.SimpleOnGestureListener() { public void onLongPress(MotionEvent e) {

Continue reading