I would like to make a preference activity like this...if CheckBox1 is checked, my program must execute the instructions contained in activity2 ... my program is correct? I have this error: "an error has occurred in sub: main_createpreferencescreen (java line:249)...have you declared this activity in your AndroidManifest.xml?" I must declared the activity in my manifest?
This is the code:
This is the code:
B4X:
'Activity module
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim screen As PreferenceScreen
Dim manager As PreferenceManager
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.
End Sub
Sub Activity_Create(FirstTime As Boolean)
CreatePreferenceScreen
End Sub
Sub CreatePreferenceScreen
screen.Initialize("screen","")
Dim cat1 As PreferenceCategory
cat1.Initialize("Category 1")
cat1.AddCheckBox("check1", "Checkbox1", "This is Checkbox1", False)
screen.AddPreferenceCategory(cat1)
StartActivity(screen.CreateIntent)
End Sub
Sub Activity_Resume
Dim m As Boolean
m=manager.GetBoolean("check1")
If m=True Then
StartActivity(Activity2)
End If
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub