% 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. Performance: pre-instantiate activities on app launch? Good practice or not?

Hi guys,

our app is getting bigger and more complicated lately, and I
definitely noticed a loss in responsiveness and overall snappy-ness.
Besides onCreate handlers becoming slower (we use lots of custom view
drawables now, because the Android stock styles don't work for us
anymore), sometimes, when a class is used for the first time, the
Android class loader lazy loads that class which significantly slows
down activity load times.

I was therefore wondering if you know whether it's possible and common
practice to load activities and classes which are anticipated to be
loaded anyway during application start, e.g. by using Class.forName or
even explicitly calling Activity.onCreate simply to already have it
readily constructed as soon as the user actually wants to use it? A
loading screen would be shown meanwhile.

I have never seen an Android app doing this, but on the iPhone, almost
any application goes through a loading process when starting up.

Any thoughts on best practices and solutions here?

Thanks for your input,
Matthias
--~--~---------~--~----~------------~-------~--~----~

2. Some question about OrientationListener and the way of sensor( sensorlistener, sensormanager..... ) init

Hi all:

when I study in rotation, I think we can use sensor to setRotation if
we set  mCurrentAppOrientation =
ActivityInfo.SCREEN_ORIENTATION_SENSOR.

1.Do I think correct for mCurrentAppOrientation?

I try to modify mCurrentAppOrientation =
ActivityInfo.SCREEN_ORIENTATION_SENSOR then updateOrientationListener
() will enable mOrientationListener.
In the enable function,the second parameter is SENSOR_ACCELEROMETER.

2.Is type:SENSOR_ACCELEROMETER correct for setRotation ?
3.What is type: TYPE_ORIENTATION use for?

enable function in OrientationListener.java will call
registerListener, and registerListener call registerLegacyListener.In
registerLegacyListener call getDefaultSensor and alwaye return null.
So the sensor is null. Maybe because sensorlist is empty. There are
some comment as below :
                                if (sensor != null)
               // If we don't already have one, create a
LegacyListener
                // to wrap this listener and process the events as
                // they are expected by legacy apps.
I try to modify if (sensor != null) to if (sensor == null) , the
emulator will reboot again and again.
4.How can I init sensor (or sensormanager....) to make a sensorlist?
5.Is there any sample code for init sensor (or sensormanager....)?
6.Does android have support Hi all:

when I study in rotation, I think we can use sensor to setRotation if
we set  mCurrentAppOrientation =
ActivityInfo.SCREEN_ORIENTATION_SENSOR.

1.Do I think correct for mCurrentAppOrientation?



I try to modify mCurrentAppOrientation =
ActivityInfo.SCREEN_ORIENTATION_SENSOR then updateOrientationListener
() will enable mOrientationListener.
In the enable function,the second parameter is SENSOR_ACCELEROMETER.

2.Is type:SENSOR_ACCELEROMETER correct for setRotation ?
3.What is type: TYPE_ORIENTATION use for?

enable function in OrientationListener.java will call
registerListener, and registerListener call registerLegacyListener.In
registerLegacyListener call getDefaultSensor and alwaye return null.
So the sensor is null. Maybe because sensorlist is empty. There are
some comment as below :
                                if (sensor != null)
               // If we don't already have one, create a
LegacyListener
                // to wrap this listener and process the events as
                // they are expected by legacy apps.
I try to modify if (sensor != null) to if (sensor == null) , the
emulator will reboot again and again.
4.How can I init sensor (or sensormanager....) to make a sensorlist?
5.Is there any sample code for init sensor (or sensormanager....)?
6.Does android have support type:Hi all:

when I study in rotation, I think we can use sensor to setRotation if
we set  mCurrentAppOrientation =
ActivityInfo.SCREEN_ORIENTATION_SENSOR.

1.Do I think correct for mCurrentAppOrientation?



I try to modify mCurrentAppOrientation =
ActivityInfo.SCREEN_ORIENTATION_SENSOR then updateOrientationListener
() will enable mOrientationListener.
In the enable function,the second parameter is SENSOR_ACCELEROMETER.

2.Is type:SENSOR_ACCELEROMETER correct for setRotation ?
3.What is type: TYPE_ORIENTATION use for?

enable function in OrientationListener.java will call
registerListener, and registerListener call registerLegacyListener.In
registerLegacyListener call getDefaultSensor and alwaye return null.
So the sensor is null. Maybe because sensorlist is empty. There are
some comment as below :
                                if (sensor != null)
               // If we don't already have one, create a
LegacyListener
                // to wrap this listener and process the events as
                // they are expected by legacy apps.
I try to modify if (sensor != null) to if (sensor == null) , the
emulator will reboot again and again.
4.How can I init sensor (or sensormanager....) to make a sensorlist?
5.Is there any sample code for init sensor (or sensormanager....)?

6.Does andorid have support sensor type:SENSOR_LIGHT?

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

3. App Idea: Very interesting, unique, and information efficient text-entry method -- (no keyboard(not even on screen KB))

4. Paid upgrades discussion

5. hi,anybody know the OMTP Application Security Framework and android compliance

6. Debug.startMethodTracing InternalError: file open failed

7. pricing model for a service based android application/game?