Android Question OpenVpn client app hides my app

Milan Bozic

Member
Licensed User
Hello.
My app has been configured to start at boot.
But just after rebooting, openvpn client setup screen hides my app.
If I dismiss openvpn, my app comes back to foreground.
I already inserted a timer that checks if my app is paused, but it does not work with openvpn.

B4X:
If IsPaused(Main) Then StartActivity(Main)
How can I hide automatically openvpn cllient?

Thanks
 

Milan Bozic

Member
Licensed User
More details:
1) openvpn setup screen appears only if there is no wifi connection in that moment
2) problem come up only on android 8 (not android 7)
 

Milan Bozic

Member
Licensed User
All right, solved:
Openvpn client was called with intent from my app.

B4X:
Dim i As Intent
    i.Initialize("net.openvpn.openvpn.CONNECT","")
    i.SetComponent("net.openvpn.openvpn/net.openvpn.unified.MainActivity")
    i.PutExtra("net.openvpn.openvpn.AUTOCONNECT", True)
    StartActivity(i)
But when the app started on reboot of the phone, phone was going in standby (screen locked).
Unlocking screen sent me directly to openvpn client (which was enabled from my intent in the meanwhile)
Solved by disabling lockscreen in phone settings.
Don't understand why android 7 worked differently (lock screen did not cause the problem) :)mad:)
 
Last edited:
Top