Java Question XML error

barx

Well-Known Member
Licensed User
Longtime User
Can anybody spot why this Documentation code causes an
'The XML is improperly formatted. Please escape if necessary'
Error?

B4X:
/**
    * Sets the parameters for a progress bar used in a notification. Only use with "twotextplusprogress" Preset or if defined as part of a user defined layout.
    * For Preset layout the id is "progress".
    * 
    * maxProgress - the upper limit of the progress bar. A good value is 100
    * progress - the current level of progress to be shown. Must be <= maxProgress. 
    */

Got other ones that are very similar and they are fine.

Tried escaping the " quotes with /". Again other codes with ""'s in are fine?

Got me a little puzzled.
 

barx

Well-Known Member
Licensed User
Longtime User
Just thought of that whilst at work. It clicked that xml uses < and > tko mean important things. You have just confirmed my thought. Cheers. Will give it a go when I get home.

Sent from my HTC Vision using Tapatalk
 

barx

Well-Known Member
Licensed User
Longtime User
Just to report back.

Worked a treat thanks.
 

barx

Well-Known Member
Licensed User
Longtime User
Rather than create a new post with the same title, I'm having formatting issues again. Can anyone see what is the issue here:

B4X:
   /**
    * Initializes a Hover Listener against a given View.
    * 
    * View - The View that will react to the Hover event
    * EventName - The sub that will handle the events
    * 
    * Be sure to add the following to the manifest using the Manifest Editor:-
    * addactivitytext(Main, &lt;intent-filter&gt;
    * &lt;action android:name=&quot;com.sec.android.airview.HOVER&quot; /&gt;
    * &lt;/intent-filter&gt;)
    */

I believe the issue lays with the manifest edit.
The original text reads:

B4X:
addactivitytext(Main, <intent-filter>
    <action android:name="com.sec.android.airview.HOVER" />
</intent-filter>)
 
Last edited:

barx

Well-Known Member
Licensed User
Longtime User
After a little more investigation, it appears it may not be this doc section, yet this is the only doc section in the lib.

Here is the full XML for the lib

B4X:
<?xml version="1.0" encoding="UTF-8"?>
<root>
    <doclet-version-NOT-library-version>1.02</doclet-version-NOT-library-version>
    <class>
        <name>BarxDroid.AirView.AirView</name>
        <shortname>AirViewListener</shortname>
        <owner>process</owner>
        <event>HoverStart(x as Float, y as Float)</event>
        <event>HoverEnd(x as Float, y as Float)</event>
        <event>HoverMove(x as Float, y as Float)</event>
        <method>
            <name>Initialize</name>
            <comment>Initializes a Hover Listener against a given View.
 
 View - The View that will react to the Hover event
 EventName - The sub that will handle the events
 
 Be sure to add the following to the manifest using the Manifest Editor:-
 addactivitytext(Main, &amp;lt;intent-filter&amp;gt;
 &amp;lt;action android:name=&amp;quot;com.sec.android.airview.HOVER&amp;quot; /&amp;gt;
 &amp;lt;/intent-filter&amp;gt;)</comment>
            <returntype>void</returntype>
            <parameter>
                <name>ba</name>
                <type>anywheresoftware.b4a.BA</type>
            </parameter>
            <parameter>
                <name>view</name>
                <type>android.view.View</type>
            </parameter>
            <parameter>
                <name>Eventname</name>
                <type>java.lang.String</type>
            </parameter>
        </method>
    </class>
    <version>0.91</version>
    <author>BarxDroid</author>
</root>
 

barx

Well-Known Member
Licensed User
Longtime User
Yes, i did.

As a list resort late last night, I tried restarting b4a. Even though I had been refreshing the lib list, unchecking and checking the lib and cleaning the project.

Restarting b4a seemed to fix. Strange but true...
 
Top