Hi,
I have been using Activity.Finish before loading another Activity but just wondering if I used the following code would this also close my app completely, or will it cause errors?
It seems to work fine on my device, but want to know if this would work as well.
I have been using Activity.Finish before loading another Activity but just wondering if I used the following code would this also close my app completely, or will it cause errors?
It seems to work fine on my device, but want to know if this would work as well.
B4X:
Dim package As String
package = "my.app.here"
Dim sb As StringBuilder
sb.Initialize
Phone.Shell("ps", Null, sb, Null)
Dim m As Matcher
m = Regex.Matcher2("^[^ ]*\s+(\d+) .*" & package, Regex.MULTILINE, sb.ToString)
If m.Find Then
Log("Package found: " & package)
Phone.Shell("kill", Array As String(m.Group(1)), Null, Null)
End If