Intent intent = new Intent().setAction(ConnectivityManager.CONNECTIVITY_ACTION);
sendBroadcast(intent);
Exception:
java.lang.RuntimeException: Unable to start activity ComponentInfo{Activity_Index}:
java.lang.SecurityException: Permission Denial: not allowed to send broadcast
android.net.conn.CONNECTIVITY_CHANGE from pid=19360, uid=10052
Manifest permissions:
<!-- Connectivity Manager -->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
<!-- Connectivity Manager -->
<!-- WIFI -->
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<!-- WIFI -->