-2

I have loaded a local HTML file from assets folder into WebView.Also On WebView long click its open a custom dialog box. This is my code:

 pageView.setOnLongClickListener(new View.OnLongClickListener() {
        @Override
        public boolean onLongClick(View view) {
            String names[] ={"Copy","Bookmark","Note"};
            final AlertDialog.Builder alertDialog = new AlertDialog.Builder(getActivity());
            LayoutInflater inflater = getActivity().getLayoutInflater();
            View convertView = (View) inflater.inflate(R.layout.custom_dialog, null);
            alertDialog.setView(convertView);
            ListView lv = (ListView) convertView.findViewById(R.id.listView1);
            ArrayAdapter<String> adapter = new ArrayAdapter<String>(getActivity(),android.R.layout.simple_list_item_1,names);
            lv.setAdapter(adapter);
            final AlertDialog ad=alertDialog.show();
            return false;
        }
    });

Now I want to add bookmark functionality on selected text. How is it possible?

Danh
  • 5,916
  • 7
  • 30
  • 45

1 Answers1

1

I haven't tried it at all But you can try below solution.

For that you have to add custom css style in your html file as below :

* {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);  
}

here it will disable highlight color of selected text. Try it out and let me know Is it working or not?

Kirankumar Zinzuvadia
  • 1,249
  • 10
  • 17