title: Can we start internet(Mobile Data and WIFI) programmatically in android?
body: <p>I am trying for solution for just on one click we can check tyhe network status with this code</p>
  
  <pre><code>ConnectivityManager ConnectionManager=(ConnectivityManager)getSystemService(Context.CONNECTIVITY_SERVICE);
                  NetworkInfo networkInfo=ConnectionManager.getActiveNetworkInfo();
                  if(networkInfo != null &amp;&amp; networkInfo.isConnected()==true )
                  {
                     // Toast.makeText(SplashScreen.this, "Network Available", Toast.LENGTH_LONG).show();
  
  }
  </code></pre>
  
  <p>But if network is not available then can we write code (like permission granting on one button click on dialog )for enable mobile data or WiFi with one button click in application pro grammatically</p>