Well, the title says what I am looking for. No combination has worked thus far. I need to add a Try into the below code where as when the manager is not enabled it will catch and throw an error toast and end the process.
Some of the code has been removed. As this is a collaboration I cannot post it in its entirety.
Some of the code has been removed. As this is a collaboration I cannot post it in its entirety.
B4X:
Sub ImageView1_Click
If manager.Enabled Then
manager.LockScreen
manager.ResetPassword (File.ReadString(File.DirDefaultExternal, "PWD.txt"))
End If
ToastMessageShow("Device Administration is not enabled. Please enable in the main application.",True)
SMTP.Initialize("smtp.gmail.com", 465, "[email protected]", "xxxxxxxxxxx", "SMTP")
SMTP.UseSSL = True
SMTP.To.Add (File.ReadString(File.DirDefaultExternal, ""))
SMTP.Subject = "Passcode"
SMTP.Body = ""
SMTP.AddAttachment(File.DirDefaultExternal, "")
SMTP.Send
rv.UpdateWidget
End Sub