Android Tutorial [B4X] Corona Cases - Cross platform Example


Licensed User
Hopefully, all the properties available now for the left Yaxis will also be available for the right Yaxis such as text color . . .
I answered in the xChart thread, because this discussion is not really related to this thread.
Are you sure you are 75 years old and not pulling our legs?
The body yes, and fortunately I am in good health and in a good shape.
In the mind and brain I feel younger, hopefully it's not only illusion.
Last edited:


Licensed User
B4A 9.8
Hi Erel,
i have Download your Example ans the XChart Lib, but i dont Understand this Error....
Logger verbunden mit: 9DCDUxxxxxxxxxxxxxxx
--------- beginning of system
--------- beginning of main
Copying updated assets files (3)
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
Read countries data
Error occurred on line: 505 (B4XTable)
java.lang.RuntimeException: Object should first be initialized (B4XView).
at anywheresoftware.b4a.AbsObjectWrapper.getObject(
at anywheresoftware.b4a.objects.B4XViewWrapper.asViewWrapper(
at anywheresoftware.b4a.objects.B4XViewWrapper.getTag(
at b4a.example.b4xtable._setpagelabelstate(
at b4a.example.b4xtable._clearnavigationstate(
at b4a.example.b4xtable$ResumableSub_Clear.resume(
at b4a.example.b4xtable._clear(
at b4a.example.sharedmain._preparetable(
at b4a.example.sharedmain._loaddata(
at b4a.example.sharedmain._initialize(
at b4a.example.main._activity_create(
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(
at b4a.example.main.afterFirstLayout(
at b4a.example.main.access$000(
at b4a.example.main$
at android.os.Handler.handleCallback(
at android.os.Handler.dispatchMessage(
at android.os.Looper.loop(
at java.lang.reflect.Method.invoke(Native Method)
** Activity (main) Resume **


Staff member
Licensed User
You are probably using an old version of B4XTable. Use v1.21+.


Active Member
Licensed User
I get this by compiling:
B4A Version: 9.80
Java Version: 11
Parsing code.    (0.20s)
Building folders structure.    (0.03s)
Running custom action.    Error
   ROBOCOPY     ::     Robustes Dateikopieren fr Windows                             
  Gestartet: Freitag, 27. M„rz 2020 12:28:58
   Quelle : C:\sergio\B4A\examples\co\Shared Files\
     Ziel : C:\sergio\B4A\examples\co\B4A\Files\
    Dateien : *.*
  Optionen: *.* /DCOPY:DA /COPY:DAT /R:1000000 /W:30
2020/03/27 12:28:58 FEHLER 2 (0x00000002) Zugriff auf Quellverzeichnis C:\sergio\B4A\examples\co\Shared Files\
Das System kann die angegebene Datei nicht finden.


Well Known Member
Licensed User
In the Corona example by Erel on the first post, I tried the new feature from xChart 4.90: chart.DifferentScales=True (added by klaus) to use the 'Deaths' in the 2nd Yaxis (right) since the values are a lot smaller than the cases, but everywhere I put it in the code it hangs up the program. Where exactly does that line of code go?
Thank you

Jorge M A

Active Member
Licensed User
Sub B4XTable1_DataUpdated
    For i = 0 To B4XTable1.VisibleRowIds.Size - 1
        Dim RowId As Long = B4XTable1.VisibleRowIds.Get(i)
        Dim pnl As B4XView = GraphColumn.CellsLayouts.Get(i + 1) '+1 because of header layout
        Dim ChartParent As B4XView = pnl.GetView(1)
        If RowId > 0 Then
            ChartParent.SetLayoutAnimated(0, 0, 0, pnl.Width, pnl.Height)
            ChartParent.Visible = True
            Dim Chart As xChart = ChartParent.Tag
            Chart.DifferentScales=True '<-------
            'this is only needed in B4A as the Base_Resize event will be raised automatically in B4J and B4i.
            If xui.IsB4A Then Chart.Base_Resize(ChartParent.Width, ChartParent.Height)

            Chart.AddLine("Cases", xui.Color_Blue)
            Chart.AddLine("Deaths", xui.Color_Red)
            Dim Country As String = B4XTable1.GetRow(RowId).Get(CountryColumn.Id)
            AddPointsToChart(CountriesData.Get(Country), Chart)
            ChartParent.Visible = False
        End If
End Sub


Well Known Member
Licensed User
Chart.DifferentScales=True '<-------
Did it work for you where you placed it. Because I have already tried it there on a 10 inch tablet, the app locked up. I tried it on a Galaxy S6 phone, it showed the first page and locked up. Then I tried it on a Galaxy S10e phone, it showed the first page and then it locked up. Please check it out again.


Licensed User
I set it in the Designer, but as Mahares reported, the first page is shown and then the program is blocked.
I saw it yesterday evening and it's on my to do list for this morning to look at it.