[android-developers] Re: WebView : can we select text in Java ?

2009-09-17 Thread Miguel Paraz

On Sep 17, 8:13 pm, Nanard bsegon...@free.fr wrote:
 Hi,

 I'd like to use WebView to display some content (from my Java code or
 local temp file).

 I need to select some characters (change background color) of the
 view. Of course I need to change those selected char. using my Java
 code.

 How can it be done ?

 Can you post a short example ?

Sorry I have no example, but basically, it's not possible to change
the content of the WebView. All you can do is loadUrl() new URLs.

However, you can loadURL(javascript:methods()) to call JavaScript
code in your WebView content. That will do the work of changing the
color using the DOM, or anything dynamic you need.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: WebView : can we select text in Java ?

2009-09-08 Thread Fred Grott(Android Expert)

make it a DOM node than its possible as most DOM objects are
sleectable in webview

On Sep 8, 4:59 am, Nanard bsegon...@free.fr wrote:
 Hi,

 I like WebView component.
 I would like to be able to select text in the view in my Java code.

 Is it possible ?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: WebView : can we select text in Java ?

2009-09-08 Thread Nanard

OK, thanks.

I will check how DOM objects work on Android...
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: WebView : can we select text in Java ?

2009-09-08 Thread Mark Murphy

Jason Proctor wrote:
 the regular WebKit has a method to run arbitrary javascript and 
 return any results. if you gave the text a DOM ID then you could 
 select it via this method.
 
 unfortunately it looks like the Android interface to WebKit doesn't 
 include this facility.

You can use loadUrl() with javascript: URLs. However, I don't know
where you'd get the DOM ID, unless it was via a call from Javascript
into Java via addJavascriptInterface().

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

_The Busy Coders' Guide to *Advanced* Android Development_ In Print!

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---