F Federico956 Member Licensed User Longtime User Nov 14, 2014 #1 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
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
Erel B4X founder Staff member Licensed User Longtime User Nov 16, 2014 #2 Federico956 said: Anyone know If is it possible to have an activity inside a b4a library? Click to expand... It is possible. How are you calling the activity from the class module?
Federico956 said: Anyone know If is it possible to have an activity inside a b4a library? Click to expand... It is possible. How are you calling the activity from the class module?
F Federico956 Member Licensed User Longtime User Nov 17, 2014 #3 Erel said: How are you calling the activity from the class module? Click to expand... Code: Copy Dim ltx As LibTx 'LibTx is my library I'll do Initialize and other declaration then I call: Code: Copy ltx.StartaFtp This is the activity I need to call: Code: Copy Public Sub StartaFtp Try StartActivity("FrmFtp") Catch Log(LastException.Message) End Try End Sub Last edited: Nov 17, 2014
Erel said: How are you calling the activity from the class module? Click to expand... Code: Copy Dim ltx As LibTx 'LibTx is my library I'll do Initialize and other declaration then I call: Code: Copy ltx.StartaFtp This is the activity I need to call: Code: Copy Public Sub StartaFtp Try StartActivity("FrmFtp") Catch Log(LastException.Message) End Try End Sub
Erel B4X founder Staff member Licensed User Longtime User Nov 17, 2014 #4 Use StartActivity(FrmFtp) instead of the string.
F Federico956 Member Licensed User Longtime User Nov 17, 2014 #5 Erel said: Use StartActivity(FrmFtp) instead of the string. Click to expand... 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: Nov 17, 2014
Erel said: Use StartActivity(FrmFtp) instead of the string. Click to expand... 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?
Erel B4X founder Staff member Licensed User Longtime User Nov 18, 2014 #6 Can you post the full error message from the logs?
F Federico956 Member Licensed User Longtime User Nov 18, 2014 #7 Erel said: Can you post the full error message from the logs? Click to expand... I only have java.lang.NullPointerException both in logs and on the Smartphone like a MsgBox2 that allows me to continue or not.
Erel said: Can you post the full error message from the logs? Click to expand... I only have java.lang.NullPointerException both in logs and on the Smartphone like a MsgBox2 that allows me to continue or not.
Erel B4X founder Staff member Licensed User Longtime User Nov 18, 2014 #8 Can you send me your project with the library to [email protected]?
F Federico956 Member Licensed User Longtime User Nov 18, 2014 #9 Erel said: Can you send me your project with the library to [email protected]? Click to expand... Sure, but since both the library and the project are very big, I'll realize a little sample and a little library with the same behavior and I'll send you all as soon as possible Edit: sent. Last edited: Nov 21, 2014
Erel said: Can you send me your project with the library to [email protected]? Click to expand... Sure, but since both the library and the project are very big, I'll realize a little sample and a little library with the same behavior and I'll send you all as soon as possible Edit: sent.