D DevBaby Active Member Licensed User Longtime User May 6, 2016 #1 I was trying to implement additional lifecycle events do to an sdk requirement. I added Code: Copy #Region Activity Attributes #Extends: b4a.ActivityLifeCycleEvents #End Region and then added... Activity_Start Activity_Stop Activity_Destroy Activity_BackPressed And got the following error Compiling generated Java code. Error javac 1.7.0_55 src\am\gameplus\pkg\main.java:17: error: package b4a does not exist public class main extends b4a.ActivityLifeCycleEvents implements B4AActivity{ ^ Note: src\am\gameplus\pkg\inappbillingservice.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. 1 error
I was trying to implement additional lifecycle events do to an sdk requirement. I added Code: Copy #Region Activity Attributes #Extends: b4a.ActivityLifeCycleEvents #End Region and then added... Activity_Start Activity_Stop Activity_Destroy Activity_BackPressed And got the following error Compiling generated Java code. Error javac 1.7.0_55 src\am\gameplus\pkg\main.java:17: error: package b4a does not exist public class main extends b4a.ActivityLifeCycleEvents implements B4AActivity{ ^ Note: src\am\gameplus\pkg\inappbillingservice.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. 1 error
Erel B4X founder Staff member Licensed User Longtime User May 6, 2016 #2 The correct way is to use the hooks system: https://www.b4x.com/android/forum/threads/inline-java-code.50141/#content Upvote 0
The correct way is to use the hooks system: https://www.b4x.com/android/forum/threads/inline-java-code.50141/#content
D DevBaby Active Member Licensed User Longtime User May 10, 2016 #3 Erel said: The correct way is to use the hooks system: https://www.b4x.com/android/forum/threads/inline-java-code.50141/#content Click to expand... Thanks Erel, The sdk fires simple methods for each lifecycle event, for instance... Code: Copy @Override public void onStart() { super.onStart(); Chartboost.onStart(this); } 1) Using inline java, would I still use "this"? In the wrapper, i used "ba.activity". 2) Using the wrapper, I needed the @DependsOn(Chartboostsdk), would I need something similar with inline java? Upvote 0
Erel said: The correct way is to use the hooks system: https://www.b4x.com/android/forum/threads/inline-java-code.50141/#content Click to expand... Thanks Erel, The sdk fires simple methods for each lifecycle event, for instance... Code: Copy @Override public void onStart() { super.onStart(); Chartboost.onStart(this); } 1) Using inline java, would I still use "this"? In the wrapper, i used "ba.activity". 2) Using the wrapper, I needed the @DependsOn(Chartboostsdk), would I need something similar with inline java?
Erel B4X founder Staff member Licensed User Longtime User May 10, 2016 #4 1) You don't need to use ba.activity as the code is added to the activity class. 2) You need to use #AdditionalJar: Chartboostsdk Upvote 0
1) You don't need to use ba.activity as the code is added to the activity class. 2) You need to use #AdditionalJar: Chartboostsdk