I am trying for solution for just on one click we can check tyhe network status with this code
ConnectivityManager ConnectionManager=(ConnectivityManager)getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo networkInfo=ConnectionManager.getActiveNetworkInfo();
if(networkInfo != null && networkInfo.isConnected()==true )
{
// Toast.makeText(SplashScreen.this, "Network Available", Toast.LENGTH_LONG).show();
}
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