Is it possible to call the OS "Shutdown/Reboot/Airplane" menu display from within an app.
I would like to display this when the user clicks the "Exit" button of my app.
Actually, if you have a rooted phone you can do it like this:
Shutdown the phone:
B4X:
Sub Shutdown
Dim ph As Phone
Dim Command, Runner As String
Dim StdOut, StdErr As StringBuilder
StdOut.Initialize
StdErr.Initialize
Runner = File.Combine(File.DirInternalCache, "runner")
Command = File.Combine(File.DirInternalCache, "command")
File.WriteString(File.DirInternalCache, "runner", "su < " & Command)
File.WriteString(File.DirInternalCache, "command", "su -c reboot -p")
ph.Shell("sh", Array As String(Runner), StdOut, StdErr)
End Sub
Reboot the phone:
B4X:
Sub Reboot
Dim ph As Phone
Dim Command, Runner As String
Dim StdOut, StdErr As StringBuilder
StdOut.Initialize
StdErr.Initialize
Runner = File.Combine(File.DirInternalCache, "runner")
Command = File.Combine(File.DirInternalCache, "command")
File.WriteString(File.DirInternalCache, "runner", "su < " & Command)
File.WriteString(File.DirInternalCache, "command", "su -c reboot")
ph.Shell("sh", Array As String(Runner), StdOut, StdErr)
End Sub