An Android library that allows you to easily check android applications Network Connectivity.Shows dialog fragment when connection is lost and the dialog fragment is dismissed when connection is back.
You may use it in your Android apps provided that you cite this project and include the license in your app. Thanks!
Add it in your root build.gradle at the end of repositories:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
dependencies {
implementation 'com.github.vasu-bhardwaj:NoInternet:V1.3'
}
After creating instance of fragmentManager and NoNet.
get supported fragmentManager in onCreate(), method
and init the NoNet dialog in onCreate method
public class MainActivity extends AppCompatActivity {
private FragmentManager fm = null;
private NoNet mNoNet;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
fm = getSupportFragmentManager();
mNoNet = new NoNet();
mNoNet.initNoNet(this, fm);
}
@Override
protected void onResume() {
mNoNet.RegisterNoNet();
super.onResume();
}
@Override
protected void onPause() {
mNoNet.unRegisterNoNet();
super.onPause();
}
To report a specific problem or feature request,, please let by opening a new Issue.(https://github.com/vasu-bhardwaj/NoInternet/issues/new)