Shall i start a new thread or post here...
Trying out the #Extends attribute i get this compilation error:
Parsing code. 0.00
Compiling code. 0.05
Compiling layouts code. 0.02
Generating R file. 0.06
Compiling generated Java code. Error
javac 1.8.0_05
src\uk\co\martinpearman\b4a\analyticsmanagerdemo\main.java:30: error: method does not override or implement a method from a supertype
@Override
^
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
1 error
Lines 30 and 31 in the compiled b4a main.java read:
@Override
public void onCreate(Bundle savedInstanceState) {
My library sub classes Activity to enable Flurry analytics:
package uk.co.martinpearman.b4a.analytics;
import com.flurry.android.FlurryAgent;
import android.app.Activity;
import android.content.res.Resources;
import anywheresoftware.b4a.BA;
import anywheresoftware.b4a.BA.DependsOn;
import anywheresoftware.b4a.BA.Hide;
import anywheresoftware.b4a.BA.Permissions;
@DependsOn(values={
"flurryAnalytics_3.4.0"
})
@Hide
@Permissions(values={
"android.permission.ACCESS_NETWORK_STATE",
"android.permission.INTERNET"
})
public class AnalyticsActivity extends Activity{
public static boolean FLURRY_ANALYTICS_ENABLED=false;
public static String FLURRY_API_KEY=null;
static{
Resources resources=BA.applicationContext.getResources();
int resourceId=resources.getIdentifier("flurryApiKey", "string", BA.packageName);
if(resourceId==0){
FLURRY_ANALYTICS_ENABLED=false;
FLURRY_API_KEY=null;
} else {
FLURRY_ANALYTICS_ENABLED=true;
FLURRY_API_KEY=resources.getString(resourceId);
}
}
@Override
protected void onStart() {
super.onStart();
if(FLURRY_ANALYTICS_ENABLED){
FlurryAgent.onStartSession(this, FLURRY_API_KEY);
}
}
@Override
protected void onStop() {
super.onStop();
if(FLURRY_ANALYTICS_ENABLED){
FlurryAgent.onEndSession(this);
}
}
}
And my b4a Main Activity:
#Region Project Attributes
#ApplicationLabel: AnalyticsManager
#VersionCode: 1
#VersionName: 1
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#AdditionalRes: C:\path\to\AnalyticsManager\res, uk.co.martinpearman.b4a.analyticsmanagerdemo
#Extends: uk.co.martinpearman.b4a.analytics.AnalyticsManager
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
End Sub
Sub Globals
End Sub
Sub Activity_Create(FirstTime As Boolean)
' check out the Manifest Editor to see modifications made for the demo
' check out the res\values\analytics_manager.xml file where Flurry api key is defined
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
I tried implementing B4AActivity in my AnalyticsActivity and also commenting out it's static constructor.
Also tried overriding onCreate in my AnalyticsActivity - just called super.onCreate(savedInstanceState) here.
No matter what i do it fails to compile with the same error.
Compiling using android API 17 for both B4A and Eclipse.
Eclipse is set to use java complinace level 1.6.
Any ideas?
Thanks.
Martin.