title: CaptivePortal not working in custom Android Oreo System
body: <p>We have a custom Android Oreo System which does not have a web browser in it. 
  When the system connects to Network with Captive Portal, CaptivePortalLoginActivity gets launched with this SSL error: </p>
  
  <blockquote>
    <p>The network you're trying to join has security issues. 
    For example the login page may not belong to the organization shown.
    CONTINUE ANYWAY VIA BROWSER</p>
  </blockquote>
  
  <p>but upon clicking CONTINUE ANYWAY VIA BROWSER the app crashes because there is no browser present.</p>
  
  <pre><code>11-19 05:00:03.912 10434 10434 D CaptivePortalLoginActivity: starting activity with intent ACTION_VIEW for http://connectivitycheck.gstatic.com/generate_204
  11-19 05:00:03.916  2565  8240 I ActivityManager: START u0 {act=android.intent.action.VIEW dat=http://connectivitycheck.gstatic.com/...} from uid 10019
  11-19 05:00:03.920 10434 10434 D AndroidRuntime: Shutting down VM
  --------- beginning of crash
  11-19 05:00:03.921 10434 10434 E AndroidRuntime: FATAL EXCEPTION: main
  11-19 05:00:03.921 10434 10434 E AndroidRuntime: Process: com.android.captiveportallogin, PID: 10434
  11-19 05:00:03.921 10434 10434 E AndroidRuntime: java.lang.RuntimeException: Unable to destroy activity {com.android.captiveportallogin/com.android.captiveportallogin.CaptivePortalLoginActivity}: android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=http://connectivitycheck.gstatic.com/... }
  11-19 05:00:03.921 10434 10434 E AndroidRuntime:    at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:4385)
  11-19 05:00:03.921 10434 10434 E AndroidRuntime:    at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:4401)
  11-19 05:00:03.921 10434 10434 E AndroidRuntime:    at android.app.ActivityThread.access$1900(ActivityThread.java:176)
  11-19 05:00:03.921 10434 10434 E AndroidRuntime:    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1649)
  11-19 05:00:03.921 10434 10434 E AndroidRuntime:    at android.os.Handler.dispatchMessage(Handler.java:106)
  11-19 05:00:03.921 10434 10434 E AndroidRuntime:    at android.os.Looper.loop(Looper.java:164)
  11-19 05:00:03.921 10434 10434 E AndroidRuntime:    at android.app.ActivityThread.main(ActivityThread.java:6494)
  11-19 05:00:03.921 10434 10434 E AndroidRuntime:    at java.lang.reflect.Method.invoke(Native Method)
  11-19 05:00:03.921 10434 10434 E AndroidRuntime:    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
  11-19 05:00:03.921 10434 10434 E AndroidRuntime:    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
  11-19 05:00:03.921 10434 10434 E AndroidRuntime: Caused by: android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=http://connectivitycheck.gstatic.com/... }
  11-19 05:00:03.921 10434 10434 E AndroidRuntime:    at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1937)
  11-19 05:00:03.921 10434 10434 E AndroidRuntime:    at android.app.Instrumentation.execStartActivity(Instrumentation.java:1616)
  11-19 05:00:03.921 10434 10434 E AndroidRuntime:    at android.app.Activity.startActivityForResult(Activity.java:4487)
  11-19 05:00:03.921 10434 10434 E AndroidRuntime:    at android.app.Activity.startActivityForResult(Activity.java:4445)
  11-19 05:00:03.921 10434 10434 E AndroidRuntime:    at android.app.Activity.startActivity(Activity.java:4806)
  11-19 05:00:03.921 10434 10434 E AndroidRuntime:    at android.app.Activity.startActivity(Activity.java:4774)
  11-19 05:00:03.921 10434 10434 E AndroidRuntime:    at com.android.captiveportallogin.CaptivePortalLoginActivity.onDestroy(CaptivePortalLoginActivity.java:270)
  11-19 05:00:03.921 10434 10434 E AndroidRuntime:    at android.app.Activity.performDestroy(Activity.java:7208)
  11-19 05:00:03.921 10434 10434 E AndroidRuntime:    at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1249)
  11-19 05:00:03.921 10434 10434 E AndroidRuntime:    at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:4370)
  11-19 05:00:03.921 10434 10434 E AndroidRuntime:    ... 9 more
  11-19 05:00:03.925 10434 10434 I Process : Sending signal. PID: 10434 SIG: 9
  </code></pre>
  
  <p>How to handle Captive Portal without a web browser in Android Oreo? </p>