Intent intent = new Intent().setAction(ConnectivityManager.CONNECTIVITY_ACTION);
sendBroadcast(intent);
例外:
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
マニフェストのアクセス許可:
<!-- 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 -->