PhoneGap html5 app on Android 4.0 long press

android, cordova, html

Solution

update your app class with:

public class MainActivity extends DroidGap {

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    super.loadUrl("file:///android_asset/www/index.html");

    super.appView.setOnLongClickListener(new View.OnLongClickListener() {

        public boolean onLongClick(View v) {
            return true;
        }
    });
}}

Problem

Hi I have a an android app built with PhoneGap. So, the user interface is built as HTML5 page. It worked fine until I tested this on Android 4.0, now when I long press, android give me option to select the text in the UI and also gives me options on top to share bookmark etc. Can anyone help me turn this off?

Original source