Skip to content

Commit

Permalink
Added internet connectivity check before loading client info
Browse files Browse the repository at this point in the history
 Fix openMF#1559 - fixed toast message in client info page
  • Loading branch information
danishjamal104 committed Nov 16, 2020
1 parent c59191c commit 5ced72c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Binary file added mifosng-android/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@

import android.Manifest;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.database.Cursor;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
Expand Down Expand Up @@ -224,7 +227,13 @@ void onClickActivateClient() {
}

public void inflateClientInformation() {
mClientDetailsPresenter.loadClientDetailsAndClientAccounts(clientId);
ConnectivityManager connectivityManager = (ConnectivityManager) getContext().getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo networkInfo = connectivityManager.getActiveNetworkInfo();
if(networkInfo != null && networkInfo.isConnected()){
mClientDetailsPresenter.loadClientDetailsAndClientAccounts(clientId);
return;
}
showFetchingError("Device not connected to internet");
}

@Override
Expand Down

0 comments on commit 5ced72c

Please sign in to comment.