As you can see in this screenshot, I have a Receiver that seems to work. However I cannot get the Main activity to start with either just calling StartActivity(Main) or StartActivity(intent) in this context.
I am running on Android SDK 34 and latest Emulator image.
Is there something I am not doing?
I am running on Android SDK 34 and latest Emulator image.
Is there something I am not doing?
Receiver:
Sub Process_Globals
Dim Timer1 As Timer
End Sub
'Called when an intent is received.
'Do not assume that anything else, including the starter service, has run before this method.
Private Sub Receiver_Receive (FirstTime As Boolean, StartingIntent As Intent)
Log("Step 1")
Timer1.Initialize("Timer1",5000)
Timer1.Enabled=True
End Sub
Sub Timer1_Tick
Log("Step 2")
Timer1.Enabled=False
ToastMessageShow("eCongress Kiosk Receiver",True)
Log("Step 3")
'Dim intent As Intent
'intent.Initialize("android.intent.action.MAIN", "")
'intent.SetComponent("com.econgress.kiosk/.main") ' Adjust if needed
StartActivity(Main)
Log("Step 4")
End Sub
Manifest:
'This code will be applied to the manifest file during compilation.
'You do not need to modify it in most cases.
'See this link for for more information: https://www.b4x.com/forum/showthread.php?p=78136
AddManifestText(
<uses-sdk android:minSdkVersion="20" android:targetSdkVersion="34"/>
<supports-screens android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
CreateResourceFromFile(Macro, Themes.LightTheme)
'End of default text.
AddPermission(android.permission.ACCESS_WIFI_STATE)
AddPermission(android.permission.CHANGE_WIFI_STATE)
AddPermission(android.permission.ACCESS_NETWORK_STATE)
SetApplicationAttribute(android:usesCleartextTraffic, "true")
AddPermission(android.permission.RECEIVE_BOOT_COMPLETED)
AddReceiverText(Receiver,
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"/>
</intent-filter>)
Last edited: