Android Question [Solved] RandomAccessFile WriteB4XObject Problem

Discussion in 'Android Questions' started by fixit30, Apr 7, 2015.

  1. fixit30

    fixit30 Active Member Licensed User

    Dear All.

    This is my first ever question on this forum as I have always managed to find the answer using the wealth of knowledge from previous questions so please be gentle with me!

    From this thread:

    Erel Says:

    I have created a Custom Type, however I get the following error when I call raf.WriteB4XObject

    java.lang.RuntimeException: java.lang.RuntimeException: Cannot serialize object: (ArrayList) [123]
    If I use WriteObject or WriteEncryptedObject it works fine.

    I believe this issue is related to my Custom Type containing a List.

    Is this behaviour normal?

    Attached is a very simple Sample Project which shows the problem.

    Many Thanks.


    Edit: Also, in case it matters.

    B4A Version: 4.30
    RandomAccessFile Version: 2.00

    Attached Files:

    Last edited: Apr 7, 2015
  2. Erel

    Erel Administrator Staff Member Licensed User

    It is indeed a bug related to the List inside the type. It is fixed for the next versions.
  3. fixit30

    fixit30 Active Member Licensed User

    Hi Erel.

    Many thanks for your confirmation of this issue.

    Are you able to tell me when the next version will be available?


  4. Erel

    Erel Administrator Staff Member Licensed User

    The updated library is attached.

    Attached Files:

    DonManfred, Peter Simpson and fixit30 like this.
  5. fixit30

    fixit30 Active Member Licensed User

    Thank you Erel for your speedy response. The updated library works perfectly. :D

    The performance increase of WriteB4XObject is very noticeable and has made a big difference to my app!
    Peter Simpson, Erel and DonManfred like this.
  6. MrKim

    MrKim Active Member Licensed User

    I, too am seeing this problem, I have a map with a type.
    Dim MOL As Map
    Type LOL(Sort As  Int, Fname As String, SWL As CustomListView)
    Dim Lol As LOL
        Lol.Fname = 
        Lol.Sort = 
        Lol.SWL = SwipeList
    "SwipeList", Lol)
    "ActiveZXZX", Lol)
    Dim Lol2 As LOL
        Lol2.Fname = 
        Lol2.Sort = 
        Lol2.SWL = Trash
    "Trash", Lol2)
    Dim Lol3 As LOL
        Lol3.Fname = 
        Lol3.Sort = 
        Lol3.SWL = Trash
    "Archive", Lol3)

    Dim R As RandomAccessFile

    File.Delete(File.DirInternal, "MOLZXZX")
    File.DirInternal, "MOLZXZX"False)
    I am guessing it is the CustomListView in the type?
  7. Erel

    Erel Administrator Staff Member Licensed User

    Please start a new thread for this.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice