% character not displayed correctly by WebView?

by Inderjeet Singh » Fri, 19 Dec 2008 21:43:49 GMT


Sponsored Links
 The following code snippet produces a weird browser error (Web page not
available) on WebView:

    String message = "<html><body>Show Percent: 38% </body></html>";
    WebView mWebView = (WebView) activity.findViewById(R.id.my_web_view);
    mWebView.loadData(message, "text/html", "en_US");

The offending character is "%".  I tried using the entity code for %, but it
made no difference. Anyone knows what is going on?
Thanks
Inder

--~--~---------~--~----~------------~-------~--~----~



% character not displayed correctly by WebView?

by joshv » Fri, 19 Dec 2008 22:21:35 GMT


 Use loadDateWithBaseURL - pass it a dummy base URL.



--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Other Threads

1. W/WifiService( 887): misformatted scan result for: 00:xx:xx:xx:xx:xx 2 187 [WPA2-PSK-TKIP+CCMP]

Hi,
     I get the following error in logcat for wifiservice, with
wpa_supplicant-0.6.10, and with debug logs enabled.

We're using android-2.2.1_r1, wpa_supplicant-0.6.10 with a TI Murata
wl1271 wlan module with an OMAP3503 processor.

Which component processes the scan results?

I've suppressed the mac addresses from the log output.

03-02 12:40:17.143 W/WifiService(  887): misformatted scan result for:
00:xx:xx:xx:xx:xx       2       187     [WPA2-PSK-TKIP+CCMP]
03-02 12:40:17.143 W/WifiService(  887): misformatted scan result for:
00:xx:xx:xx:xx:xx       2       186     [WPA2-PSK-TKIP+CCMP]
03-02 12:40:17.143 W/WifiService(  887): misformatted scan result for:
00:xx:xx:xx:xx:xx       2       180     [WPA2-PSK-TKIP+CCMP]
03-02 12:40:17.143 W/WifiService(  887): misformatted scan result for:
00:xx:xx:xx:xx:xx       2       177     [WPA2-PSK-TKIP+CCMP]
03-02 12:40:17.159 W/WifiService(  887): misformatted scan result for:
00:xx:xx:xx:xx:xx       2       173     [WPA2-PSK-TKIP+CCMP]
03-02 12:40:17.159 W/WifiService(  887): misformatted scan result for:
00:xx:xx:xx:xx:xx       2       172     [WPA2-PSK-TKIP+CCMP]
03-02 12:40:17.159 W/WifiService(  887): misformatted scan result for:
00:xx:xx:xx:xx:xx       2       172     [WPA2-PSK-TKIP+CCMP]
03-02 12:40:17.159 W/WifiService(  887): misformatted scan result for:
00:xx:xx:xx:xx:xx       169     [WPA2-PSK-TKIP+CCMP]
03-02 12:40:17.159 W/WifiService(  887): misformatted scan result for:
00:xx:xx:xx:xx:xx       2       186     [WEP]
03-02 12:40:17.159 W/WifiService(  887): misformatted scan result for:
00:xx:xx:xx:xx:xx       2       183     [WEP]
03-02 12:40:17.159 W/WifiService(  887): misformatted scan result for:
00:xx:xx:xx:xx:xx       2       182     [WEP]
03-02 12:40:17.159 W/WifiService(  887): misformatted scan result for:
00:xx:xx:xx:xx:xx       2       181     [WEP]
03-02 12:40:17.159 W/WifiService(  887): misformatted scan result for:
00:xx:xx:xx:xx:xx       2       177     [WEP]
03-02 12:40:17.174 W/WifiService(  887): misformatted scan result for:
00:xx:xx:xx:xx:xx       2       175     [WEP]
03-02 12:40:17.174 W/WifiService(  887): misformatted scan result for:
00:xx:xx:xx:xx:xx       2       175     [WEP]
03-02 12:40:17.174 W/WifiService(  887): misformatted scan result for:
00:xx:xx:xx:xx:xx       2       175     [WEP]
03-02 12:40:17.174 W/WifiService(  887): misformatted scan result for:
00:xx:xx:xx:xx:xx       2       173     [WEP]
03-02 12:40:17.174 W/WifiService(  887): misformatted scan result for:
00:xx:xx:xx:xx:xx       2       173     [WEP]
03-02 12:40:17.174 W/WifiService(  887): misformatted scan result for:
00:xx:xx:xx:xx:xx       2       172     [WEP]

Elvis Dowson

-- 

2. How to get an event for soft keyboard KEYCODE_DEL?

Hi,

In my application, I bring the soft keyboard on from time to time, and
it looks like events for the DEL key are not delivered. The method in
question is at

http://pastebin.com/zZaZWJ4t

and the whole Java class is at

http://squeakvm-tablet.googlecode.com/hg/project/src/org/squeak/android/SqueakView.java

Any alphanumeric key or Enter (Return) tapped on the soft keyboard is
passed to the application except for KEYCODE_DEL. I tried to replace
KEYCODE_DEL in the case clause with anything else (e. g. with code for
for hardware button PAGE_UP), and the clause takes control when that
button is pressed.

I did not subclass the Android Keyboard class, just used the default
input manager.

What can be done in order to receive events for KEYCODE_DEL? Is
deriving a subclass the only way?

Thanks.

PS When the soft keyboard is visible, toast messages do not show up
although key events definitely pass through (I can e. g. enter text
into Squeak workspace). Is this normal behavior of toasts?

-- 

3. Ada yang dapet notifikasi update ke gingerbread di CM7?

4. Gingerbread InputReader

5. Android roadmap.

6. watch online video

7. LVL and In-App Billing...