Skip to content

Instantly share code, notes, and snippets.

View geftimov's full-sized avatar
🇧🇬
This feature is great!!!

Georgi Eftimov geftimov

🇧🇬
This feature is great!!!
View GitHub Profile
@geftimov
geftimov / android-connectivity-change
Last active August 1, 2018 15:16
Register and unregister connectivity receiver when needed.
private ConnectivityChangeReceiver mConnectivityChangeReceiver;
@Override
protected void onResume() {
super.onResume();
mConnectivityChangeReceiver = new ConnectivityChangeReceiver();
registerReceiver(mConnectivityChangeReceiver, new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION));
}
@Override