naoak / WebViewMarker

Support library for text selection on Android WebView. (forked from BTAndroidWebViewSelection)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

selectionChanged on SelectionListener not Working!!

masoud-c opened this issue · comments

I use this code to get selected text, startSelection and endSelection work fine but selectionChanged never get called... what's the problem?

    mTextSelectionSupport.setSelectionListener(new TextSelectionSupport.SelectionListener() {
        @Override
        public void startSelection() {
            Toast.makeText(ReadBookActivity.this, "s", Toast.LENGTH_SHORT).show();
        }
        @Override
        public void selectionChanged(String text) {
            selectedText = text;
            Toast.makeText(ReadBookActivity.this, text, Toast.LENGTH_SHORT).show();
        }
        @Override
        public void endSelection() {
            Toast.makeText(ReadBookActivity.this, "e", Toast.LENGTH_SHORT).show();
        }
    });

Strange. @masoudfcr Could you tell me your environment?

thanks @naoak , that was because of a variable name isRealChanged in the listener.... i removed it and it worked
i work on Intellij Idea, API Level 22, jdk 1.8

its not working in 6.0. can you update it. Thanks

i am using this method
webview.loadData(text, mimeType, encoding);

Sorry, I'm not keeping up Android development surroundings since ICS. So, I cannot answer immediately that this can work in 6.0. By the way, I never thought this is in demand until Android version becomes 6.0 :)

You got people attention. Would you like to work on it?Thanks

I can't work on it right way, but I'll keep it in mind. Thanks.