Android Question OpenVpn client app hides my app

Discussion in 'Android Questions' started by Milan Bozic, Aug 13, 2019.

Similar threads

B4A Question Intent for OpenVPN
B4A Question How To Merge b4a on OpenVpn
B4A Question OpenVPN
B4A Question SIP/VOIP
B4A Tutorial Immersive Mode - hide the navigation bar
  1. Milan Bozic

    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.

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

    Thanks
     
  2. Milan Bozic

    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)
     
  3. Erel

    Erel Administrator Staff Member Licensed User

    Is OpenVpn a system app?
     
  4. Milan Bozic

    Milan Bozic Member Licensed User

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

    Code:
    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: Aug 13, 2019
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice