Bug? Activity inside b4a library

Federico956

Member
Licensed User
Longtime User
Hi all,

I have made a b4a library with an activity inside called from a class module of the library.
I had this message error: "java.lang.ClassCastException: java.lang.NoClassDefFoundError cannot be cast to java.lang.Exception"

I have already copied all .bal and images in my main project folder.

Anyone know If is it possible to have an activity inside a b4a library?

Thank you
 

Federico956

Member
Licensed User
Longtime User
How are you calling the activity from the class module?

B4X:
Dim ltx As LibTx   'LibTx is my library

I'll do Initialize and other declaration then I call:

B4X:
ltx.StartaFtp

This is the activity I need to call:
B4X:
Public Sub StartaFtp
   Try
       StartActivity("FrmFtp")
   Catch
       Log(LastException.Message)
   End Try
End Sub
 
Last edited:

Federico956

Member
Licensed User
Longtime User
Use StartActivity(FrmFtp) instead of the string.
Thank you very much Erel, now it works but I have found two potentially problems:

In the same situation (Activity in a library) if I debug in rapid mode I have "NullPointerException" error, instead if I debug in Legacy mode it works correctly. The potentially problem should be the Keyword Activity used in the library (I call Activity.Title and Activity.Color), because if I remove them from the library it works correctly in rapid debug mode too.

Is a rapid debug mode problem or I was wrong something?
 
Last edited:
Top