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

inflateClientInformation() method modifiede in clientDetailsFragment.java to meet the cheecklist
  • Loading branch information
danishjamal104 committed Nov 16, 2020
1 parent c59191c commit 8a90109
Show file tree
Hide file tree
Showing 2 changed files with 12 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,15 @@ void onClickActivateClient() {
}

public void inflateClientInformation() {
mClientDetailsPresenter.loadClientDetailsAndClientAccounts(clientId);
Context context = getContext();
Object systemService = context.getSystemService(Context.CONNECTIVITY_SERVICE);
ConnectivityManager connectivityManager = (ConnectivityManager) systemService;
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 8a90109

Please sign in to comment.