Пример #1
0
 private void onCamera(Intent intent) {
   if (mPhotoPath != null) {
     Uri imgUri = Uri.fromFile(new File(mPhotoPath));
     filePath = AndroidUtils.getPath(this, imgUri);
     Utils.galleryAddPic(this, filePath);
     onPhoto(imgUri);
   } else {
     if (intent != null) {
       Uri imgUri = intent.getData();
       filePath = AndroidUtils.getPath(this, imgUri);
       Utils.galleryAddPic(this, filePath);
       onPhoto(imgUri);
     } else {
       askRePickPhoto();
       return;
     }
   }
 }
Пример #2
0
 private void onPhoto(Uri imgUri) {
   filePath = AndroidUtils.getPath(this, imgUri);
   if (UIUtils.ensureNetworkInternet(this, false)) {
     if (filePath != null) {
       requestUpdateAvatar(filePath);
     } else {
       hideLoading();
       UIUtils.alert(this, R.string.file_not_found);
     }
   }
 }