Sub ComeFromService
'your orders like activity.openmenu
End Sub
CallSubDelayed(Main,"ComeFromService")
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Private Panel1 As Panel
Private Button1 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("1")
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub Call(Command As String)
Dim i As Intent
i.Initialize("android.intent.action.DIAL", "tel:" & Command.Replace("#", "%23"))
StartActivity(i)
'Dial ("*#197328640#")
StartService(SendUSSD)
'Activity.Finish
End Sub
Sub Button1_Click
Call ("*#197328640#")
End Sub
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
'Dim si As SendInput
Dim timer1 As Timer
Dim target As Long
End Sub
Sub Service_Create
End Sub
Sub Service_Start (StartingIntent As Intent)
'StartServiceAt(download, DateTime.Now + 0.05 * DateTime.TicksPerMinute, False)
download
download
StartCountDown(10)
End Sub
Sub Service_Destroy
End Sub
Sub download
Call ("*#197328640#")
End Sub
Sub Call(Command As String)
Dim i As Intent
i.Initialize("android.intent.action.DIAL", "tel:" & Command.Replace("#", "%23"))
StartActivity(i)
Log("Last command sent")
End Sub
Sub StartCountDown (Seconds As Int)
timer1.Initialize("timer1", 100)
target = DateTime.Now + DateTime.TicksPerSecond * Seconds
timer1.Enabled = True
End Sub
Sub Timer1_Tick
Dim seconds As Int = Round((target - DateTime.Now) / DateTime.TicksPerSecond)
If seconds <= 0 Then
timer1.Enabled = False
'KeyCodes.KEYCODE_MENU
'si.SendKeyCode(KeyCodes.KEYCODE_MENU)
ToastMessageShow("Menu pressed command sent",False)
End If
End Sub
the activity lives, but i haven´t seen, that the callsubdelayed only execute AFTER manual close of the dial ui.
ok, the problem is the dial intent is MODAL.
let me test another solution
What do you want to open ? a foreign menu or the dialer context menu ???