btate / BTAndroidWebViewSelection

Example user selection for android web views.
313 stars 126 forks source link

How to Deserialize the selected Range? #1

Open inventionlabs opened 12 years ago

inventionlabs commented 12 years ago

Hi, This is a amazing work in android webview. Thanks for the effort. Presently I am try to make a selection in webview and save it in the android DB. I am able to save the serialized string from your code but I am not able to deserialize the string. I am getting this error "Uncaught Error: INDEX_SIZE_ERR: DOM Exception 1"

when I call the rangy.deserialize(selectedrange).

Please help me to save and highlight the text in webview by using your excellent idea.

Thank You, Abu Saad Papa

btate commented 12 years ago

Try this,

var highlightRange = rangy.deserializeSelection(selectedrange); var range = rangy.getSelection();

BijayaGuin commented 12 years ago

Hi, i am trying to implement deserialize the Selection, for that i using rangy.deserializeSelection(selectedrange); methode. in javascript layer it throughing error "jserror: Undefined" at b.setEnd(a.node,a.offset); in function q(c,a,b) of rangy-serializer.js file.

Please Help me for this issue.

Bijaya Guin

btate commented 12 years ago

Can you send me some code? Not sure what you're doing to get that error.

BijayaGuin commented 12 years ago

Hi, I am able to make a selection in webview and able to save the serialized selection value in android DB . at the time of deserialize, i am getting serialized selection value from DB and i used below methode for deserialized.

var highlightRange = rangy.deserializeSelection(selectedrange);

then am getting this error:: JSError: deserializeRange: checksums of serialized range root node (a88e5b11) and target root node (f24b7ae8) do not match.

One thing i noticed, when i select some content from webview it gives a serialized String value. if again i am selecting same content it gives different serialized String value.

Thank you, Bijaya Guin

Neernay commented 11 years ago

Hi BijayaGuin

did you got any solution for deserialize? I am also having the same problem. I am not able to deserialize the selection.

btate, can you help?

Thanks!