Hi,
i want to start a activity that is build in a custom library. I got no error messages, but it doesen't work. I see the log informtin in b4a.
Here is some code:
Here is the 1. class of the library:
Here is the activity:
I need heeeeeelp. :BangHead:
Thank you for reading
i want to start a activity that is build in a custom library. I got no error messages, but it doesen't work. I see the log informtin in b4a.
Here is some code:
B4X:
#Region Project Attributes
#ApplicationLabel: B4A Example
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim cmp20 As CitizenCMP20
Dim Button1 As Button
Dim Button2 As Button
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("TestPrint")
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub Button1_Click
Log("Button1_Click")
'i call the function start() from CitizenCMP20 here
cmp20.Start
End Sub
Sub Button2_Click
End Sub
Here is the 1. class of the library:
B4X:
package com.mcdreck.citizentest;
import android.content.Intent;
import anywheresoftware.b4a.BA;
import anywheresoftware.b4a.BA.Author;
import anywheresoftware.b4a.BA.DependsOn;
import anywheresoftware.b4a.BA.Permissions;
import anywheresoftware.b4a.BA.ShortName;
import anywheresoftware.b4a.BA.Version;
import anywheresoftware.b4a.keywords.Common;
@Permissions(values = {"android.permission.BLUETOOTH", "android.permission.BLUETOOTH_ADMIN", "android.permission.WRITE_EXTERNAL_STORAGE"})
@DependsOn(values={ "Citizen_Android_1056" })
@Author("NeverGiveUp2")
@Version((float) 1.07)
@ShortName("CitizenCMP20")
public class CitizenCMP20 {
public CitizenCMP20(){
}
public void Start(){
Common.Log("for new Intent");
Intent in = new Intent( BA.applicationContext, TestActivity.class);
Common.Log("forr startActivity");
startActivity(in);
}
private void startActivity(Intent in) {
// TODO Auto-generated method stub
}
}
Here is the activity:
B4X:
package com.mcdreck.citizentest;
import android.content.Intent;
import anywheresoftware.b4a.BA;
import anywheresoftware.b4a.BA.Author;
import anywheresoftware.b4a.BA.DependsOn;
import anywheresoftware.b4a.BA.Permissions;
import anywheresoftware.b4a.BA.ShortName;
import anywheresoftware.b4a.BA.Version;
import anywheresoftware.b4a.keywords.Common;
@Permissions(values = {"android.permission.BLUETOOTH", "android.permission.BLUETOOTH_ADMIN", "android.permission.WRITE_EXTERNAL_STORAGE"})
@DependsOn(values={ "Citizen_Android_1056" })
@Author("NeverGiveUp2")
@Version((float) 1.07)
@ShortName("CitizenCMP20")
public class CitizenCMP20 {
public CitizenCMP20(){
}
public void Start(){
Common.Log("for new Intent");
Intent in = new Intent( BA.applicationContext, TestActivity.class);
Common.Log("forr startActivity");
startActivity(in);
}
private void startActivity(Intent in) {
// TODO Auto-generated method stub
}
}
}
I need heeeeeelp. :BangHead:
Thank you for reading